Hi everybody
I want to detect the following string by preg_match function:
<a onclick="javascript: if (document.all) window.document.body.scrollTop=0; else window.pageYOffset=0; return false; " href="#" border="0"><img src="http://aljazeera.net/NEWS/KEngine/imgs/top-page.gif" align="left" border="0"></a>
This code isn't working:
$str = '<a onclick="javascript: if (document.all) window.document.body.scrollTop=0; else window.pageYOffset=0; return false; " href="#" border="0"><img src="http://aljazeera.net/NEWS/KEngine/imgs/top-page.gif" align="left" border="0"></a> xxx';
echo preg_replace('/<a(.*)href=\"([^\"]*)\">(.*)<\/a>/iU', '', $str);
anyone can help please?