Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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']
 
PREVIOUS NEXT
Tagged: #overwrite #existing #key #pair #php
ADD COMMENT
Topic
Name
2+9 =