David Russell wrote:
> Hey there
> I told you my brain was feeling fuzzy :)
> This works great. Only one problem... I would like it to be case
> insensitive... Any way?
> I assume that it would be a ereg/preg replace, but I have no clue with
> regexp at all.
Try the following one:
$result = "This is a test, isn't it?";
$search = "is";
$result = preg_replace( '/(' . $search . ')/i', "<span
class=\"highlight\">\$1</span>", $result );
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php