Re: [PHP] search highlighting

2001-04-12 Thread Plutarck
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

[PHP] search highlighting

2001-04-12 Thread Matt Williams
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