note 19615 added to function.eregi-replace
| From: | sungam at e-box dot dk | Date: | Wed, 06 Mar 2002 03:58:45 +0000 |
| Subject: | note 19615 added to function.eregi-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27389@lists.php.net to get a copy of this message | ||
Actually, as far as I can tell, eregi_replace would be required in this example.
str_replace(' ','',$string) would erase all spaces from the string.
eregi_replace(' +',' ',$string) would also erase all spaces, but would insert a
single space (whether there was one or several before) in every instance.
As a result, eregi_replace removes _excess_ spaces, while str_replace simply removes _all_ spaces,
which might not be a good idea.
--
http://www.php.net/manual/en/function.eregi-replace.php
http://master.php.net/manage/user-notes.php?action=edit+19615
http://master.php.net/manage/user-notes.php?action=delete+19615
http://master.php.net/manage/user-notes.php?action=reject+19615