Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #replace #string #array #values
ADD COMMENT
Topic
Name
4+5 =