Re: NO case replace

From: Date: Wed, 27 Dec 2000 20:43:10 +0000
Subject: Re: NO case replace
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-32005@lists.php.net to get a copy of this message
eregi_replace() should do it... $str = "This is this is THiS"; $new_str = eregi_replace('(this)', '<b>\\1</b>', $str); echo $new_str; on 12/27/00 3:16 PM, PHP List at enelson@netsolutionsllc.com wrote: > I want to do a case-insensitive search through a string and replace with an > insensitive string... for instance: > > $str = "This is this is THiS"; > > I need to run a replace that will turn this string into the following: > > $new_str = "<b>This</b> is <b>this</b> is > <b>THis</b>"; > > Thanks for the input > >

« previous php.general (#32005) next »