PHP strtr()
程序员文章站
2022-03-08 21:32:40
...
strtr()
strtr(string,from,to)
strtr(string,array)
string1
from
to
array
strtr(string,from,to)
strtr(string,array)
string1
from
to
array
<?php
echo strtr("Hilla Warld","ia","eo");
?>
Hello World
<?php
$arr = array("Hello" => "Hi", "world" => "earth");
echo strtr("Hello world",$arr);
?>
Hi earth