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

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

WBOY
Release: 2016-06-13 10:15:56
Original
736 people have browsed it

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template