note 14033 deleted from function.ereg-replace by jimw
| From: | jimw@php.net | Date: | Fri, 02 Nov 2001 01:58:54 +0000 |
| Subject: | note 14033 deleted from function.ereg-replace by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-20215@lists.php.net to get a copy of this message | ||
Dear joseph@yesterdayland.com:
The reason eregi_replace does "weird things" if you do this:
$str = "This...is...awesome!";
$str = eregi_replace("...", " ", $str);
Is that the period matches any character. So you are replacing any character with a space.
The fix is to escape the period:
$str = "This...is...awesome!";
$str = eregi_replace("\.\.\.", " ", $str);
echo $str;
That will output:
This is awesome!