Re: replace
| From: | Richard Lynch | Date: | Fri, 28 Jan 2005 16:11:59 +0000 |
| Subject: | Re: replace | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-207604@lists.php.net to get a copy of this message | ||
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