我想用$ sq中的单词加粗来回显$ desc。这是我的代码如下所示:这个PHP脚本有什么问题?
<?php
$desc = "This a sentence witch contains 4 words on is Hello the other is moto the third is hoto and finally but not least nono.";
$sq = "Hello moto hoto nono";
$pieces = explode(" ", $sq);
foreach (array($pieces[0], $pieces[1],$pieces[2],$pieces[3],$pieces[4]) as $item)
$descr = str_replace($item, "<b>".$item."</b>", $desc);
echo $descr;
?>
感谢
“这一句”忘了是 – user666605 2011-04-01 14:01:35
对不起我的英语 – user666605 2011-04-01 14:14:43