From ab57066b4f2acac1449f7db9b4d221709903cb1c Mon Sep 17 00:00:00 2001 From: Torben Wilson Date: Wed, 26 Jan 2000 20:58:36 +0000 Subject: [PATCH] More example for file(). git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@18828 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/filesystem.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/functions/filesystem.xml b/functions/filesystem.xml index b0f747568c..fa1fd0e380 100644 --- a/functions/filesystem.xml +++ b/functions/filesystem.xml @@ -570,8 +570,11 @@ fclose ($fd); <?php -// get a web page into an array +// get a web page into an array and print it out $fcontents = file( 'http://www.php.net' ); +while ( list( $line_num, $line ) = each( $fcontents ) ) { + echo "<b>Line $line_num:</b> " . htmlspecialchars( $line ) . "<br>\n"; +} // get a web page into a string $fcontents = join( '', file( 'http://www.php.net' ) );