Home  >  Article  >  Backend Development  >  小弟我想抓去一个网页,为什么为空?代码如下

小弟我想抓去一个网页,为什么为空?代码如下

WBOY
WBOYOriginal
2016-06-13 13:37:02873browse

我想抓去一个网页,为什么为空?代码如下
$url = "http://shanghai.55tuan.com/";
$fcontents = file_get_contents($url);
preg_match("/(.*)/", $fcontents, $regs);
echo $regs[1];
?>

------解决方案--------------------
preg_match("/(.*)/s", $fcontents, $regs);
你看看还空吗???
------解决方案--------------------
是啊,搞采集,搞抓取就用snoopy这个类嘛,功能强大哈

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn