Page 1 of 1

highlight search word

Posted: Sun Jan 16, 2005 5:06 pm
by HormonX
Can anyone point me in a right direction on how to highlight a word that user has been searching for ?

thank you

Greg

Posted: Sun Jan 16, 2005 5:13 pm
by JAM
str_replace the searched word with a css-class that does the highlightning...

Code: Select all

Original text: Foo is something bar I say! Har har...
Searching for: bar
New text after str_replace: Foo is something <b class="h">bar</b> I say! Har har...
...just to name one ill-written example. But it's an direction... =)