php数组合并用加号和用array_merge()的区别
第一先看数组元素: <?php$a = array('r'=>1,2,3,4); var_dump('a',$a); $b = array('r'=>5,6,7,8); var_dump('b',$b); $c = array('r'=>5,6,7,8,9); var_dump('c',$c); var_dump('a+b',$a+$b); var_dump('a+c', $a+$c); var_dump('amb', array_merge($a, $b)); var_dump('amc', array_merge($a, $c)); 第二看输出: string 'a' (length=1)array 'r' => int 1 0 => int 2 1 => int 3 2 => int 4string 'b' (length=1)array 'r' => int 5 0 => int 6 1 => int 7 2 => int 8string 'c' (length=1)array 'r' => int 5 0 => int 6 1 => int 7 2 => int 8 3 => int 9string 'a+b' (length=3)array 'r' => int 1 0 => int 2 1 => int 3 2 => int 4string 'a+c' (length