http://www.php.net/manual/en/function.s ... .php#33425
Code: Select all
function highlight($x,$var) {
if ($var != "") {
$xtemp = "";
$i=0;
while($i<strlen($x)){
if((($i + strlen($var)) <= strlen($x)) && (strcasecmp($var, substr($x, $i, strlen($var))) == 0)) {
$xtemp .= "<b>" . substr($x, $i , strlen($var)) . "</b>";
$i += strlen($var);
}
else {
$xtemp .= $x{$i};
$i++;
}
}
$x = $xtemp;
}
return $x;
}Code: Select all
Script Installation, trouble installing web scripts, perl scripts, Downloads, Free Software Download, Free Ware Download, Free Webmaster Tools - Apply Tools FREE WEBMASTER DOWNLOADS | FREE SOFTWARE DOWNLOAD | FREE WARE DOWNLOAD | FREE WEBMASTER TOOLS Your Ad Here Search FeaturesI know that I need to break $var into pieces and then highlight them individually, but I dont know how to do it. Can anyone show me how?
Thank you in advance!