基于array1合并两个数组

时间:2009-05-11 17:49:41

标签: php arrays

我正在尝试合并两个数组,用于设置的array1的值

Array1 ( [0] => false [1] => 200 )
Array2 ( [0] => true [1] => 80 [2] => 60 [3] => 75 [4] => 50 [5] => 0 [6] => 0 [7] => 30 [8] => 40 ) 

例如结果数组:

Array3 ( [0] => false [1] => 200 [2] => 60 [3] => 75 [4] => 50 [5] => 0 [6] => 0 [7] => 30 [8] => 40 ) 

处理这个问题的有效方法是什么。

由于

1 个答案:

答案 0 :(得分:3)

使用数组联合运算符。

$array3 = $array1 + $array2;