note 4466 deleted from ereg_replace by ronabop

From: Date: Sat, 26 Aug 2000 05:40:44 +0000
Subject: note 4466 deleted from ereg_replace by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-3339@lists.php.net to get a copy of this message
I wrote some code which uses ereg_replace to replace 'Welcome "to the" world' with 'Welcome to_the world'. It works, like it should but, I need to generalise it to work with quotes that contain more than one space, eg 'Welcome "to the world"' goes to 'Welcome to_the_world'. The code I have atm is: <PRE>$searchtext = eregi_replace(""([a-z0-9.-]*) ([a-z0-9.-]*)"", "\1_\2",$searchtext);</PRE> Any suggestions?

« previous php.notes (#3339) next »