Re: replace

From: Date: Fri, 28 Jan 2005 16:35:56 +0000
Subject: Re: replace
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-207607@lists.php.net to get a copy of this message
thanks...I will look that up. Not very good with regular expressions though. On Fri, 28 Jan 2005 08:11:59 -0800 (PST), Richard Lynch <ceo@l-i-e.com> wrote: > blackwater dev wrote: > > I have a section of my site that uses HTMLArea to allow the users to > > manage content. For one certain section, they want all of their links > > to pop up in another window. I know they can use HTMLArea and add > > this code themselves but they don't want to get to the code side of > > it. > > > > Currently, I just pull out the entire contents and echo them to the > > screen: > > > > echo $sql->getField('content'); > > > > but now I need to replace each anchor tag from > > <A href="http://www.something.com/"> > > to > > <A > > href="javascript:pop('http://www.something.com/')"> > > > > I can easily use str_replace() to replace "<a href="javascript:pop( " > > but how do I add the last )? > > http://php.net/preg_replace > would probably be easiest. > > -- > Like Music? > http://l-i-e.com/artists.htm > >

« previous php.general (#207607) next »