是否可以组合数组,并基本上将它们附加到一个大数组:
$a = array(1,2,3,4);
$b = array(5,6,7,8);
$c = array(1,2,3,4);
以便输出为:
$result = array(1,2,3,4,5,6,7,8,1,2,3,4);
这可能吗?
感谢您的帮助!
答案 0 :(得分:19)
http://php.net/manual/en/function.array-merge.php
$a = array(1,2,3,4);
$b = array(5,6,7,8);
$c = array(1,2,3,4);
$out = array_merge($a, $b, $c);
结果:
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
[5] => 6
[6] => 7
[7] => 8
[8] => 1
[9] => 2
[10] => 3
[11] => 4
)