Mohamed,

I still can't seem to get it working:

<?
$str = "<a href='somewhere/else.html'>foo</a>";
$str = preg_replace("!<a href='([^>]*)'>([^<]*)</a>!",'blah',$str);
echo $str;
?>

echo's '<a href='somewhere/else.html'>foo</a>' rather than 'blah'

Justin


On Monday, October 13, 2003, at 10:17 PM, Mohamed Lrhazi wrote:


I would try a petern like this:

$pattern="!<a href='([^>]*)'>([^<]*)</a>!"

check the docs for greedy not greedy thingy...

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



Reply via email to