Re: Exact string replacement...

From: Date: Sat, 09 Feb 2002 16:32:18 +0000
Subject: Re: Exact string replacement...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-84106@lists.php.net to get a copy of this message
use substr_replace string substr_replace(string text, string replacement, integer start, integer length) EG: <? $text = "Wow! This is neat, yes it is!"; print($text); print('<br>'); print(substr_replace($text, "are", 10, 2)); ?> 10 is the place where you want it to start replacement, 2 (is) more forward it ends. "Desikan" <desikb4u@fastmail.fm> wrote in message news:20020209071737.6DE673940BF@fastmail.fm... > Hi there, > > Please help me out in the following... > > <?php > $is='is'; > echo eregi_replace(" ".$is." "," ","This is a test string > which contains > is in dismissal"); > ?> > > > Actually I want to replace "is" alone from the string and not all the > words that contains is... > > I have tried with "^".$is."$" ---> but yields nothing.... > > Also tried with "\b"... > > > thanks and regards, > Desikan > > -- > Desikan > desikb4u@fastmail.fm

« previous php.general (#84106) next »