[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-general
Subject:    [PHP] help with preg_replace only part of the string
From:       Georgi Ivanov <joro () abacustrade ! com>
Date:       2005-12-06 10:53:46
Message-ID: 200512061253.46879.joro () abacustrade ! com
[Download RAW message or body]

Hi,
I want to replace the content of html links : <a href="foo" 
name="bla">REPLACETHIS</a>.

$html=preg_replace("/(<a.*name=.*>)(.*)<\/a>/isU",$link,$html,1);
This generally works but removes <a>,</a> tags too.
How to make it work without removing anything else than (.*) in the middle of 
<a>.*</a>

Thanks in advance.

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic