2010-02-02 69 views

回答

1

您可以使用PHP

$trans = array("hello" => "hi", "said" => "screamed"); 
echo strtr("hi all, I said hello", $trans); // prints out "hi all, I screamed hi" 
0

使用preg_replace()的strtr函数的效率(或mb_strtr)函数向引用:

$text = "foo bar baz"; 
echo preg_replace('/(a)/', '<b>$1</b>', $text); 
0
preg_replace('/(a|e|i|o|u)/', '<b>$1</b>', $string); 

你有没有考虑寻找到<b> VS <strong>

相关问题