highlighting keywords problem
| From: | Christian Dechery | Date: | Tue, 24 Jul 2001 00:46:37 +0000 |
| Subject: | highlighting keywords problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-59282@lists.php.net to get a copy of this message | ||
I want to highlight some keywords in a text without losing its case.
How do I do that? I have something like the following:
$keyword="something here";
ob_start("highlight_keyword");
?>
<p><font face=tahoma size=2>just some text<br>
to get it to grab the text and highlight it<br>
the keyword is right now... check it out<br>
Something Here, see? it's with a different case...</font></p>
<?
ob_end_flush();
function highlight_keyword($buffer)
{
global $keyword;
return eregi_replace($keyword,"<b>".$keyword."</b>",$buffer);
}
the problem is that it's going to give me "...<b>something here</b>, see? it's with a different case...", with a lowercased keyword... I want to preserve the case of the found text... any ideas????
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer