Nicolas Verhaeghe wrote:
That's not where the issue is. Eregi_replace conducts a case insensitive SEARCH but how the REPLACE operates has nothing to do with it. If you use ereg_replace, then it is most obviously not going to replace "MacOS" with "<span class=highlight>macos</span>" or even "<span class=highlight>MacOS</span>", because the string searched for is of a different case.
Good point, I had it around the wrong way. function highlight_text($text, $highlight) { return eregi_replace($highlight, "<span class=highlight>" . $highlight . "</span>", $text); } So where does 'highlight' come from when you pass it in ? -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php