I am trying to overwrite the elements of one array with values from another – without creating additional elements in the process.
For example:
the following should do it:
foreach ($replace as $k => $v) if (isset($base[$k])) $base[$k]=$v;