如
$array3=array("性別"=>"男","姓名"=>"不是女人");
$array4=array("性別"=>"不知道","長相"=>"很帥");
哪麼,合並之後,後者將會覆蓋前者,這樣合並之後就變成了
Array ( [性別] => 不知道 [姓名] => 不是女人 [長相] => 很帥 )
數字型鍵名,或自動賦值鍵名,則不會產生覆蓋,
如
$array1=array(1,2,3,4,5,6,7);
$array2=array(1,7,8,9,10);
合並之後,為
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 )