array_merge <?php $array1 = array ("key1" => "val1", 2, 4); $array2 = array ("a", "b", "key1" => "val2", "etc" => "val3", 4); $result = array_merge ($array1, $array2); print_r($result); ?>
同じkeyは後ろが優先。
[key1] => val2 [0] => 2 [1] => 4 [2] => a [3] => b [etc] => val3 [4] => 4
コメントする