Answers for "overwrite existing key value pair php"

PHP
0

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']
Posted by: Guest on April-27-2021

Code answers related to "overwrite existing key value pair php"

Browse Popular Code Answers by Language