Home >php教程 >PHP源码 >php使用file_get_contents函数抓取页面信息

php使用file_get_contents函数抓取页面信息

PHP中文网
PHP中文网Original
2016-05-25 17:07:401287browse

php代码

$url="http://qita.in";
$contents=@file_get_contents($url);
//preg_match_all("/(.*?)/is",$contents,$content);
preg_match_all("/(.*?)/is",$contents,$content);
print_r($content[0]);

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