Mega Code Archive

 
Categories / Php / File Directory
 

Getting and Printing a Web Page with fopen()

<html> <head> <title>Getting a Web Page with fopen()</title> </head> <body> <div> <?php $webpage = "http://www.rntsoft.com/index.htm"; $fp = fopen( $webpage, "r" ) or die("couldn't open $webpage"); while ( ! feof( $fp )) {   print fgets( $fp, 1024 ); } ?> </div> </body> </html>