array_merge php array_merge code for array merging

WBOY
Release: 2016-07-29 08:38:27
Original
1012 people have browsed it

For example,
$array3=array("Gender"=>"Male","Name"=>"Not a woman");
$array4=array("Gender"=>"Don't know","Appearance"= >"Very handsome");
Well, after the merger, the latter will overwrite the former, so that after the merger it becomes
Array ([Gender] => I don’t know [Name] => Not a woman [Looks like] ] => Very cool)
Numeric key names, or automatically assigned key names, will not cause overwriting,
For example,
$array1=array(1,2,3,4,5,6,7);
$ array2=array(1,7,8,9,10);
After merging, it is
Array ([0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 1 [8] => 7 [9] => 8 [10] => 9 [11] => 10 )

The above introduces the code for array merging under array_merge php array_merge, including the content of array_merge. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!