📜  php 用数组值替换字符串 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:59.235000             🧑  作者: Mango

代码示例1
$string = "last_name, first_name";
$search = array('first_name', 'last_name');
$replace = array('John', 'Smith');

$result = str_replace($search, $replace, $string);