Array_merge特定顺序的两个数组

时间:2019-07-03 16:47:30

标签: php arrays array-merge

我有两个数组:

$first = array( 
[0] => '11',
[1] => '22',
[2] => '33'
);

$second = array( 
[0] => '44',
[1] => '55',
[2] => '66',
[3] => '77',
[4] => '88',
[5] => '99'
);

如何合并它们,所以新数组中的第一个对象来自数组1,第二个对象来自数组2,然后再次来自数组1,再次来自数组2等?数组的长度并不总是相同。

赞:

$newarray = array(
[0] => '11',
[1] => '44',
[2] => '22',
[3] => '55',
[4] => '33',
[5] => '66',
[6] => '77',
[7] => '88',
[8] => '99'
);

0 个答案:

没有答案