- print_r: documentation ( source)
- array_replace_recursive: documentation ( source)
<?php
$arr1 = [
"First" =>[
"Name" => "John",
"Id" => 123
],
"Second" =>[
"Name" => "Peter",
"Id" => 45
]
];
$arr2 = [
"First" =>[
"Age" => 34,
"Id" => 123
],
"Second" =>[
"Age" => 34,
"Id" => 45
]
];
print_r(array_replace_recursive($arr1, $arr2));