I.
I'm a newbie in this PHP programming stuff, but looking here and there... it goes.
๐
I'm having a trouble with some expression to separe the parts of the <a href="http://www.blablabla.com">this is a link</a> expression... In this part everything goes on... I'm able to separe the link itself ([url]http://wwww.blablabla.com)[/url], the link text (eg. this is a link).
The problem apears when the link code becomes <a href="http://www.blablabla.com"><img src="http://blablabla.com/img.gif" border="0"></a>.
The code goes like this:
=================================================
<?php
$string = $_REQUEST['url'];
function AHREF2text2($string) {
return eregi_replace('<a .href=("|\')?([^ "\'])("|\')?.>([<])</a>', '[\4] (link txt: \2) (link html: <a href="\2" target="_blank">\4</a>)', $string);
}
echo "Example<br>\n";
echo AHREF2text2($string);
?>
=================================================
You can teste it using http://your_server_url/file_name.php?url=<a href="http://www.blablabla.com"><img src="http://blablabla.com/img.gif" border="0"></a>
Can anyone help me?
Thanks a lot,
PEstevรฃo