note 24744 added to function.eregi-replace
| From: | simon_a99 at yahoo dot co dot uk | Date: | Tue, 27 Aug 2002 16:07:30 +0000 |
| Subject: | note 24744 added to function.eregi-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-35739@lists.php.net to get a copy of this message | ||
To find a string regardless of case, you might want to use the matched string in the replacement
string without changing its case.
For example, you're searching for $search = "letter" and the text being searched is
$text = "post lEtTeR". I want to change the format of the matched string.
Do this:
eregi_replace($search, "<b>\\0</b>", $text);
$text has now been changed to "post <b>lEtTeR</b>". \\0 is the entire text
matched (lEtTer in this case).
--
http://www.php.net/manual/en/function.eregi-replace.php
http://master.php.net/manage/user-notes.php?action=edit+24744
http://master.php.net/manage/user-notes.php?action=delete+24744
http://master.php.net/manage/user-notes.php?action=reject+24744