php解析出<a>标签中的“href”属性的值。

我想获取一个<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];本回答被网友采纳

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网