//加号使两个数组合并,以前面的数组为基础,相同下标取第一个数组的值
<?php
$a = array('a'=>1,'b'=>2,'c'=>3);
$b = array('a'=>2,34,4,77,99);
$c = $a + $b;
echo "<pre>";
print_r($c);
结果:
Array
(
[a] => 1
[b] => 2
[c] => 3
[0] => 34
[1] => 4
[2] => 77
[3] => 99
)
(
[a] => 1
[b] => 2
[c] => 3
[0] => 34
[1] => 4
[2] => 77
[3] => 99
)