Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== read a file by line ====== <code php> <?php $filename = "/path/to/some/file"; $fh = fopen($filename, "r"); if( !$fh ) exit("failed to open file\n"); while( $line = fgets($fh) ) echo $line; fclose($fh); ?> </code> ===== See Also ===== * [[http://us.php.net/manual/en/function.file-get-contents.php|file_get_contents]] docs/programming/php/read_a_file_by_line.txt Last modified: 2009/02/09 22:14by billh