How to find an internal combination of arrays

Source: Internet
Author: User
Evaluate the internal combination method of arrays PHPcodearray (1) {[0] & gt; array (11) {[& quot; order_sn & quot;] & gt; string (13) & quot; 2012031551539 & quot; [& quot; recede_goods_id & quot;] & gt; stri evaluate the internal combination of arrays
PHP code
  Array (1) {[0] => array (11) {["order_sn"] => string (13) "2012031551539" ["recede_goods_id"] => string (0) "" ["recede_num"] => string (3) "2, 1" ["add_time"] => string (10) & quot; 1331799888 & quot; [& quot; cause & quot;] = & quot; string (0) & quot; [& quot; type & quot;] = & quot; string (6) "change" ["add_manager"] => string (0) "" ["change_goods_id"] => string (4) "29,2" ["change_goods_size"] => array (2) {[0] => string (1) "2" [1] => string (1) "1"} ["change_goods"] => array (2) {[0] => array (3) {["goods_name"] => string (62) "seirui SWANRING semi-transparent striped ladies trousers orange half-transparent striped" ["goods_id"] => string (1) "2" ["goods_sn"] => string (10) "S12N605112"} [1] => array (3) {["goods_name"] => string (53) "seirui SWANRING sweet lady lace briefs pink" ["goods_id"] => string (2) "29" ["goods_sn"] => string (10) "S12N603171"} ["change_goods_size_name"] => array (2) {[0] => string (1) "M" [1] => string (1) "S "}}}


How to change the above array
PHP code
  Array (1) {[0] => array (11) {["order_sn"] => string (13) "2012031551539" ["recede_goods_id"] => string (0) "" ["recede_num"] => string (3) "2, 1" ["add_time"] => string (10) & quot; 1331799888 & quot; [& quot; cause & quot;] = & quot; string (0) & quot; [& quot; type & quot;] = & quot; string (6) "change" ["add_manager"] => string (0) "" ["change_goods_id"] => string (4) "29,2" ["change_goods_size"] => array (2) {[0] => string (1) "2" [1] => string (1) "1"} ["change_goods"] => array (2) {[0] => array (3) {["goods_name"] => string (62) "seirui SWANRING semi-transparent striped ladies trousers orange half-transparent striped" ["goods_id"] => string (1) "2" ["goods_sn"] => string (10) "S12N605112" ["goods_size"] => string (1) "M"} [1] => array (3) {["goods_name"] => string (53) "seirui SWANRING sweet lady lace briefs pink" ["goods_id"] => string (2) "29" ["goods_sn"] => string (10) "S12N603171" ["goods_size"] => string (1) "S "}}}}

It is how to merge change_goods and change_goods_size_name. use change_goods_size_name to give the first value to change_goods, and create a new column named goods_size for change_goods. The second column is set to the second one. And so on

------ Solution --------------------
It is best to paste the sample array, not the var_dump stuff, it looks messy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.