RE: [PHP] question about str_replace()

From: Date: Wed, 26 Jul 2000 15:19:32 +0000
Subject: RE: [PHP] question about str_replace()
Groups: php.general 
Request: Send a blank email to php-general+get-8323@lists.php.net to get a copy of this message
this works just fine: <?php $sentence = "good things are not as bad as less good things..."; $word = "good"; $newword = "bla"; echo ereg_replace("^".$word,$newword,$sentence); ?> Greetings, Jeroen Wesbeek Webdeveloper DoWebWeDo St. Jacobsstraat 16 3500 AK Utrecht 030-2348110 [ Roses are red, violets are blue, I am schizophrenic and so am I ] [ If you don't understand it, get rid of it ] -----Original Message----- From: xinkun wang [mailto:xinkun_wang@hotmail.com] Sent: woensdag 26 juli 2000 17:24 To: php-general@lists.php.net Subject: [PHP] question about str_replace() Dose anybody know if I want to replace the word which exactly begin with the word and maybe have some postfix changing. For instance I want to replace "good", "goodes", "goodbye" to new words, but not change "togood". I use $word="good"; $ins="^".$word; str_place($ins,"newword",$line); but it does not work, any ideas? please reply this email. ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com -- 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 (#8323) next »