php array merge

两个数组合并为一个数组

$a = array(1 => 1, 2 => 2, 3 => 3);
$b = array(3 => 3, 5 => 5, 6 => 6);
$c = $a + $b;
print_r($c);

结果

Array
(
    [1] => 1
    [2] => 2
    [3] => 3
    [5] => 5
    [6] => 6
)

发表评论

电子邮件地址不会被公开。 必填项已用*标注

This site uses Akismet to reduce spam. Learn how your comment data is processed.