Home >Backend Development >PHP Tutorial >PHP reads web page files_PHP tutorial

PHP reads web page files_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-13 17:44:00723browse

$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);

?>

Just start coding. If you are a technical student, you will understand

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478806.htmlTechArticle?php $handle = fopen ("http://www.example.com/", "rb") ; $contents = ""; while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle); ? ?php// For PHP 5 and above.. .
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