我想获取一个<a>标签中href的连接,如:
<A rel="nofollow" target="_blank" href=" http://m.tsci.com.cn/iPhone" class="see-all">
Tele-Trend Limited 网站 </A>
中的href= http://m.tsci.com.cn/iPhone。
无论使用什么方法...
第1个回答 2013-08-16
用正则取,例:
$str = '<A rel="nofollow" target="_blank" href=" " class="see-all">';
preg_match("/href=\"(.*)\" /", $str, $a);
print_r($a);
echo $a[1];本回答被网友采纳
$str = '<A rel="nofollow" target="_blank" href=" " class="see-all">';
preg_match("/href=\"(.*)\" /", $str, $a);
print_r($a);
echo $a[1];本回答被网友采纳