merge 数组合并
假设$a $b $c 三个数组,a和b有值,如果c没有任何数据,array_merge( $a , $b , $c )后返回的是一个null值。
$a = array(1,2,3,4);$b = array(5,6,7,8);$c = array();$rest = array_merge($a,$b,$c);print_r($rest);
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 )
$a = array(1,2,3,4);$b = array(5,6,7,8);$c = array();$rest = array_merge($a,$b,$c);print_r($rest);
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 )