A good way to make a living into a new array

Source: Internet
Author: User
A good way to survive the new array RT. How to merge two arrays with identical structures into a new array. The array following array_merge will overwrite the previous one. The array structure is. I guess you mean $ a & nbsp ;=& nbsp; array ('A' & nbsp ;=& gt. a good way to survive the new array
RT. How to merge two arrays with identical structures into a new array. The array following array_merge will overwrite the previous one.
The array structure is
------ Solution --------------------
I guess you mean this.
$a = array('a' => 1);
$b = array('a' => 1);

print_r(array_merge_recursive($a, $b));
Array
(
[A] => Array
(
[0] => 1
[1] => 1
)

)

------ Solution --------------------
Reference:
PHP code? 123456789101112131415 use array_merge_recursive .. Then $ arr = array (); $ count = count ($ data ['id']); for ($ I = 0; $ I <$ count; $ I ++) {$ arr [] = array ('I ......

Sister paper, you are like a wonderful flower shaking in the wind ......

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.