mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
78f7996190
commit
ab57066b4f
1 changed files with 4 additions and 1 deletions
|
@ -570,8 +570,11 @@ fclose ($fd);
|
|||
<informalexample>
|
||||
<programlisting>
|
||||
<?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' ) );
|
||||
|
|
Loading…
Reference in a new issue