$array
=
[
'citrus' => [
0 => 'pineapple',
],
'berries' => [
0 => 'blueberry',
1 => 'raspberry',
],
'others' => 'litchis',
]
#1
|
array_replace_recursive
|
(["citrus" => [0 => "orange"], "berries" => [0 => "blackberry", 1 => "raspberry"]], |
#2
|
array_replace_recursive
|
(["citrus" => [0 => "orange"], "berries" => [0 => "blackberry", 1 => "raspberry"], "others" => "banana"], |