More example for file().

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@18828 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Torben Wilson 2000-01-26 20:58:36 +00:00
parent 78f7996190
commit ab57066b4f

View file

@ -570,8 +570,11 @@ fclose ($fd);
<informalexample>
<programlisting>
&lt;?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 "&lt;b&gt;Line $line_num:&lt;/b&gt; " . htmlspecialchars( $line ) . "&lt;br&gt;\n";
}
// get a web page into a string
$fcontents = join( '', file( 'http://www.php.net' ) );