Answers for "changing elements of an array php"

PHP
0

php replace string with array values

$string = "last_name, first_name";
$search = array('first_name', 'last_name');
$replace = array('John', 'Smith');

$result = str_replace($search, $replace, $string);
Posted by: Guest on June-15-2021
1

update values in array in php

//With Keys
$array['key3'] = 'new value';
//Without Knowing Keys
$array[2] = 'new value';
Posted by: Guest on April-28-2020

Code answers related to "changing elements of an array php"

Browse Popular Code Answers by Language