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.