note 11630 added to ereg_replace
| From: | stadler at peppermind dot de | Date: | Wed, 28 Feb 2001 13:35:28 +0000 |
| Subject: | note 11630 added to ereg_replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-11658@lists.php.net to get a copy of this message | ||
the above mentioned
<pre>
$str = eregi_replace("[[:space:]]+", " ", $str);
</pre>
has a typo the correct spelling is
<pre>
$str = eregi_replace("[[:space:]]+", "", $str);
</pre>
"" instead of " " (else you would replace a space with a whitspace).
By the way the same error ocurs in the perl expression
<pre>
$str =~ s/\s+/ /g;
</pre>
correct:
<pre>
$str =~ s/\s+//g;
</pre>
http://www.php.net/manual/en/function.ereg-replace.php