overwrite existing key value pair php code example
Example: overwrite existing key value pair php
$replaced_arr = array_replace([
'key' => 'old_value',
0 => 'another_untouched_value'
],[
'key' => 'new_value'
]);
print_r($replaced_arr);
// ['key' => 'new_value', 0 => 'another_untouched_value']