RE: [PHP] regexp problem

From: Date: Mon, 18 Dec 2000 06:12:13 +0000
Subject: RE: [PHP] regexp problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-30835@lists.php.net to get a copy of this message
Joe's followup went something like this : $new_string = str_replace(' the ',' foo ',$old_string); Regards, Philip --.sig [ Want to write Good code? First, write Bad code. ] On Mon, 18 Dec 2000, Peter Johansson (BCS) wrote: > > If all you want to do is replace a word with another use > > str_replace() - it's quite a bit faster and just the same thing. > > > > $new_string = str_replace('the','foo',$old_string); > > Sure it's faster, but do you really want your 'thesaurus' being transformed into > 'foosaurus? I don't. > > ./peter > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#30835) next »