".$text." ";
} else {
return $text;
}
}
function highlight($needle, $haystack) {
/// This function will highlight instances of $needle in $haystack
$parts = explode(strtolower($needle), strtolower($haystack));
$pos = 0;
foreach ($parts as $key => $part) {
$parts[$key] = substr($haystack, $pos, strlen($part));
$pos += strlen($part);
$parts[$key] .= "".substr($haystack, $pos, strlen($needle))."";
$pos += strlen($needle);
}
return (join('', $parts));
}
?>
|