php array_merge 循环或类似

php array_merge looping or similar

求助于此,自己也搞不定。 需要合并动态数量的数组,但不知道如何循环 array_merge.

现在看起来像这样:

for($i=0;$<$icount;$i++){
$newContent[$i] = array_merge($content[0][$i], $content[1][$i], $content[2][$i], $content[3][$i]);
};// etc.. the numbers keeps growing.

这可行,但我必须手动添加数组。

尝试了可能重复的主题的答案,但没有给我结果。

谢谢,在 rus Whosebug 上得到了答案。

answred

for($i=0;$<$icount;$i++){
    $newContent[] = call_user_func_array(
        'array_merge',
        array_column($content, $i)
    );
}