You'll probably want to use preg_replace.
For instance:
$string = "/(PHP)/i";
$target = "Please highlight PhP for me.";
echo $target, '';
$target = preg_replace($string, "\\1", $target);
echo $target, '';
\\1 is whatever was found in the first parentheses(sp).
--
Plutarck
Should be worki
Hi
I'm implementing a simple keyword search.
I want the results to be displayed with the keywords highlighted.
I am currently using this to highlight the keywords
str_replace($string,"$string",$field);
If I search for php, it will find PHP, PhP etc... but using the above only
php will will be h
2 matches
Mail list logo