Here is the function:

function highlight_text($text, $highlight) {
return eregi_replace($highlight, "<span class=highlight>" . $highlight .
"</span>", $text);
}

In this case, if the  text to highglight is:

MacOS X Super Gizmo

And a client searches for the string "macos", the result will be:
<span class=highlight>macos</span> X Super Gizmo

You're using the eregi_replace function - which does case insensitive replaces (read the man page).

Change it to use

ereg_replace

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to