Get a web page into a string in PHP

Description

The following code shows how to get a web page into a string.

Example


<?php
$html = implode('', file('http://www.java2s.com/'));
echo $html;
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    File »




Directory
DirectoryIterator
Drive
File
File Permission
File Read Save
FileSystemIterator
Path
Zip