Re: replace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux