$array =
[0] => Array
(
[RevPReportPer] => 201606
[AcctDb] => A
[AcctNo] => 034
[AcctBusName] => test
[AcctDBAName] => test1
)
[1] => Array
(
[RevPReportPer] => 201606
[AcctDb] => A
[AcctNo] => 034
[AcctBusName] => test2
[AcctDBAName] => test2
)
[2] => Array
(
[RevPReportPer] => 201606
[AcctDb] => A
[AcctNo] => 036
[AcctBusName] => COMPUTER
[AcctDBAName] => computer2
)
[034] => Array
(
[RevPReportPer] => Array
(
[0] => 201606
[1] => 201606
)
[AcctDb] => Array
(
[0] => A
[1] => A
)
[AcctNo] => Array
(
[0] => 034
[1] => 034
)
[AcctBusName] => Array
(
[0] => test
[1] => test2
)
[AcctDBAName] => Array
(
[0] => test1
[1] => test1
)
)
[036] => Array
(
[RevPReportPer] => 201606
[AcctDb] => A
[AcctNo] => 036
[AcctBusName] => COMPUTER
[AcctDBAName] => COMPUTER2
)
我可以使用以下方式获得上述输出:
array_merge_recursive($array[0],$array[1],$array[2]);
我的问题如何将值动态传递给array_merge_recursive()
。
答案 0 :(得分:5)
使用call_user_func_array()
:
$result = call_user_func_array('array_merge_recursive', $array);