// Source
Array
(
[name] => ben
[country] => ca
[msg] => Array
(
[type] => mail
[read] => 0
[content] => hello world
)
)
// Change
Array
(
[msg] => Array
(
[read] => 1
)
)
// Result
Array
(
[name] => ben
[country] => ca
[msg] => Array
(
[type] => mail
[read] => 1
[content] => hello world
)
)
$result = php_function($source,$change);
什么php函数允许这种转换?
答案 0 :(得分:1)
您正在寻找的功能是array_merge_recursive_simple()
请参阅array_merge_resursive
修改: This one更优雅。