note 843 modified in ereg_replace by philip
| From: | philip@php.net | Date: | Mon, 27 Aug 2001 12:47:51 +0000 |
| Subject: | note 843 modified in ereg_replace by philip | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17202@lists.php.net to get a copy of this message | ||
In Perl, one thing I often do is get rid of redundant whitespace, using something like this :
$str =~ s/\s+/ /g;
If you want to do this using ereg_replace, the following works :
$str = eregi_replace("[[:space:]]+", " ", $str);
http://www.php.net/manual/en/ereg-replace.php