<?php
$entities = [
'deliveredAt' => null,
'issuedAt' => null,
'totals' => [
'due' => null,
'gross' => null,
'net' => null,
'tax' => [
'amount' => null,
'net' => null,
'rate' => null,
],
]
];
$realData = [
"issuedAt" => "2020-08-20",
"totals" => [
"tax" => [
'net' => 42,
]
]
];
print_r(array_replace_recursive($entities, $realData));
preferences:
24.46 ms | 405 KiB | 5 Q