当前位置: 代码迷 >> PHP >> 没法获取超链接
  详细解决方案

没法获取超链接

热度:153   发布时间:2013-01-11 11:57:35.0
无法获取超链接
$url="http://ca178.qjwm.com/";
$fp=@fopen($url,"r") or die("超时");
$fcontents=file_get_contents($url);
print_r($fcontents);
preg_match_all('/<a(.*?)href="(.*?)"(.*?)>.*邀请.*<\/a>/i', $fcontents, $matches);
print_r($matches);

我想获取含有邀请关键词的链接,但是一直是空的,求指导
url 链接

------解决方案--------------------
这样试试
'#<a.*href=[\'"](.*)[\'"].*>.*邀请.*</a>#is'
  相关解决方案