i have done a search-string highlighting in a search result. i use the i-modifer with preg_replace() to match all strings, neglecting the case in which they are typed in.
but i don't want to change the case in the search-result print-out.
seems that doesn't work with preg_replace() ?!
example:
$replace_what = "/myquery/i";
$replace_with = "<font color="red">myquery</font>";
$query_result = "MyQuery is here";
preg_replace($replace_what, $replace_with, $query_result);
produces (of course):
myquery is here
can i add a regexp to the $replace_with or $query_result, so that it prints out:
MyQuery is here
??
or have you got a hint for a good workaround here?
thanks..