note 19615 deleted from function.eregi-replace by sander

From: Date: Sat, 20 Apr 2002 09:26:51 +0000
Subject: note 19615 deleted from function.eregi-replace by sander
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-29600@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.

« previous php.notes (#29600) next »