Re: Reg Ex for replacing <br> or <br /> with \n

From: Date: Fri, 27 Dec 2002 15:40:10 +0000
Subject: Re: Reg Ex for replacing <br> or <br /> with \n
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-129444@lists.php.net to get a copy of this message
Yes, i thought it was simple, just wasn't escaping a forward slash $string = preg_replace( "/(<br>|<br \/>)/i" , "\n",$string); "Tom Beddard" <t.beddard@becomeinteractive.co.uk> wrote in message news:20021227150152.660.qmail@pb1.pair.com... > I'm new to using regular expressions so i'm struggling a bit in making an > expression to replace <br> or <br /> with \n > > $string = preg_replace( "/(<br>|<br />)/i" , "\n",$string); > > which needless to say doesn't work. I'm sure its obvious, just need a bit of > a pointer! > > Cheers > Tom > >

« previous php.general (#129444) next »