我想用$ 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