Method 1 (For PHP5 and above ):
$readcontents = fopen(“ http://www.phpres. com/index.html", "rb");
$contents = stream_get_contents( $readcontents);
fclose($readcontents);
echo $contents;
Method 2:
echo file_get_contents("http://www.phpres.com/index.html");
Example:
The above introduces how PHP obtains the content under the address through the web address, including the web address and PHP content. I hope it will be helpful to friends who are interested in PHP tutorials.