用正则表达式求出内容里面的以http://开头的所有url地址
<?php <br/>$str ='<a href="http://localhost">sina.com</a><a href="http://www.olders.net">健康网</a><a href="/aaa.html">sina.com</a>';<br>preg_match_all("/href=\"([^\"]+)/i", $str, $match);<br>$urls = $match[1];<br>$is_url = $_SERVER['SERVER_NAME'];<br>foreach($urls as $value)<br>{<br> if(strstr($value, $is_url)) continue;<br> echo $value . "<br>";<br>}<br>?>