search highlighting
| From: | Matt Williams | Date: | Thu, 12 Apr 2001 11:47:49 +0000 |
| Subject: | search highlighting | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-48288@lists.php.net to get a copy of this message | ||
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,"<b>$string</b>",$field);
If I search for php, it will find PHP, PhP etc... but using the above only
php will will be highlighted, not PHP.
I've tried eregi_replace but I could only get that to change the case and
highlight that ie. PHP would become php.
Can anyone point me in the direction of how to highlight the string
regardless of case but keep the case for the match.
TIA
M@