file( str ) file( str, int)
戻り値(array) | ファイルの内容1行を1つの要素とした配列 |
引数1(str) |
ファイル名、ファイルのURL "./test.txt", "http://php.pi-ppi.com/index.html" など |
引数2(int) | インクルードパスを含むかのフラグ |
<?php //ファイルの内容を配列に格納 $lines = file( 'test.txt' ); //配列の全要素に対して処理を行う foreach( $lines as $line ){ print $line; } ?>
スポンサーリンク
このサイトはリンクフリーです。リンクを貼る際に連絡は不要です。
© since 2005 PHP Webリファレンス all rights reserved.