If it ever comes in handy for anyone else, the code that did
it was :
<?php function highlightResult($keyword,$result) {
if (get_magic_quotes_gpc()) {
$replace = stripslashes($keyword);
}
else {
$replace = $keyword;
}
$replace = preg_replace("/\"|\,/i","",$replace);
$replace = preg_replace("/ {2,}/i"," ",$replace);
$replaceArr = explode(" ",$replace);
for ( $i = 0; $i < sizeof($replaceArr); $i++ ) {
$result =
preg_replace("/{$replaceArr[$i]}/i","<b>{$replaceArr[$i]}</b>",$result);
}
$highlighted = $result;
return $highlighted;
}
?>