note 31708 rejected from function.str-replace by alindeman
| From: | alindeman@php.net | Date: | Thu, 01 May 2003 00:52:17 +0000 |
| Subject: | note 31708 rejected from function.str-replace by alindeman | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-47311@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.