我有两个像这样的数组
第一个数组
Array
(
[0228] => Array
(
[name] => ''
[address] => ''
)
[0275] => Array
(
[name] => ''
[address] => ''
)
)
第二个数组
Array
(
[0228] => Array
(
[start_date] => ''
[payment] => ''
)
[0275] => Array
(
[start_date] => ''
[payment] => ''
)
)
我想通过匹配数组键来组合这两个,并像
一样输出Array
(
[0228] => Array
(
[name] => ''
[address] => ''
[start_date] => ''
[payment] => ''
)
[0275] => Array
(
[name] => ''
[address] => ''
[start_date] => ''
[payment] => ''
)
)
怎么做?这些数组合并在php中有内置函数吗?
此致
答案 0 :(得分:7)
答案 1 :(得分:6)
使用array_merge_recursive
- http://www.php.net/manual/en/function.array-merge-recursive.php