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.... thanks and regards, Desikan On Fri, 8 Feb 2002 08:52:10 -0600 , "Rick Emery" <[EMAIL PROTECTED]> said: > To get "is" alone, use " is " > > -----Original Message----- > From: Desikan [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 08, 2002 8:51 AM > To: Rick Emery > Subject: RE: [PHP-DB] Exact String replace with eregi_replace() > > > hi there, > > Actually ^string$ represents the exact match of the string alone, and not > words containg that sring... > > thanks > Desikan > > On Fri, 8 Feb 2002 08:46:32 -0600 , "Rick Emery" <[EMAIL PROTECTED]> said: > > First, the example you give will replace "is" with "," if "is" is the > > ONLY > > work in the line. You indicate this with the ^$ construct. > > > > Are you trying to replace only the first occurrence if "is"? > > > > -----Original Message----- > > From: Desikan [mailto:[EMAIL PROTECTED]] > > Sent: Friday, February 08, 2002 6:42 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP-DB] Exact String replace with eregi_replace() > > > > > > hi > > > > I'm trying to replace the exact match of 'is' with ','.. > > But all the matches of 'is' in the string gets replaced.... > > how can i avoid this??? > > > > <?php > > echo ereg_replace ("^is$", ",", "This is a dismissal of windows > > based technology"); > > ?> > > > > rgds, > > Desikan > > -- > > Desikan > > [EMAIL PROTECTED] > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > Desikan > [EMAIL PROTECTED] -- Desikan [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php