note 31708 added to function.str-replace
| From: | noel dot darlow2 at vrigin dot net | Date: | Thu, 01 May 2003 00:05:51 +0000 |
| Subject: | note 31708 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-47310@lists.php.net to get a copy of this message | ||
Would be nice if there was another (optional) parameter in str_replace to make the replacing
case-insensitive.
As an example, I have a function to highlight search terms (uses str_replace to add a span tag and a
CSS style).
If you search for "this", the search script finds items containing "This" and
"this" no problem but the str_replace will only highlight instances of "this".
An optional parameter to do a case-insensitive str_replace would be useful for situations like
these.
--
http://www.php.net/manual/en/function.str-replace.php
http://master.php.net/manage/user-notes.php?action=edit+31708
http://master.php.net/manage/user-notes.php?action=delete+31708
http://master.php.net/manage/user-notes.php?action=reject+31708