两者都是替换字符串中某个值
例如:
$a = strtr('hello', ['he' => 'n999']);
$b = str_replace('he', 'n999', 'hello');
d($b);
测试结果:$a = $b
两者都是替换字符串中某个值
例如:
$a = strtr('hello', ['he' => 'n999']);
$b = str_replace('he', 'n999', 'hello');
d($b);
测试结果:$a = $b