Home >php教程 >php手册 >PHP读取网页文件

PHP读取网页文件

WBOY
WBOYOriginal
2016-06-13 10:42:281267browse

$handle = fopen ("http://www.example.com/", "rb");

$contents = "";

while (!feof($handle)) { 

$contents .= fread($handle, 8192);

}

fclose($handle);

?>

$handle = fopen("http://www.example.com/", "rb");

$contents = stream_get_contents($handle);

fclose($handle);

?>

直接上代码了,学技术的,你会懂得

 

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