Php 如何通过继续增加键将关联数组追加到另一个关联数组中?
我有以下关联数组:Php 如何通过继续增加键将关联数组追加到另一个关联数组中?,php,arrays,Php,Arrays,我有以下关联数组: 0=> 数组(大小=2) 'id'=>字符串'0000'(长度=4) 'polling_id'=>字符串'0'(长度=1) 1 => 数组(大小=2) 'id'=>字符串'0001'(长度=4) 'polling_id'=>字符串'1'(长度=1) 我有第二个关联数组: 0=> 数组(大小=3) 'id'=>字符串'0002'(长度=4) 'polling_id'=>字符串'0'(长度=1) 'backup_id'=>字符串'4500'(长度=4) 1 => 数组(大小
0=>
数组(大小=2)
'id'=>字符串'0000'(长度=4)
'polling_id'=>字符串'0'(长度=1)
1 =>
数组(大小=2)
'id'=>字符串'0001'(长度=4)
'polling_id'=>字符串'1'(长度=1)
我有第二个关联数组:
0=>
数组(大小=3)
'id'=>字符串'0002'(长度=4)
'polling_id'=>字符串'0'(长度=1)
'backup_id'=>字符串'4500'(长度=4)
1 =>
数组(大小=3)
'id'=>字符串'0003'(长度=4)
'polling_id'=>字符串'0'(长度=1)
'backup_id'=>字符串'4500'(长度=4)
我希望它看起来像:
0=>
数组(大小=2)
'id'=>字符串'0000'(长度=4)
'polling_id'=>字符串'0'(长度=1)
1 =>
数组(大小=2)
'id'=>字符串'0001'(长度=4)
'polling_id'=>字符串'1'(长度=1)
2 =>
数组(大小=3)
'id'=>字符串'0002'(长度=4)
'polling_id'=>字符串'0'(长度=1)
'backup_id'=>字符串'4500'(长度=4)
3 =>
数组(大小=3)
'id'=>字符串'0003'(长度=4)
'polling_id'=>字符串'0'(长度=1)
'backup_id'=>字符串'4500'(长度=4)
如何实现这一点?尝试array\u merge($a1,$a2)
合并这两个数组