Show pagesourceOld revisionsBacklinksBack to top Share via Share via... Twitter LinkedIn Facebook Pinterest Telegram WhatsApp Yammer RedditRecent ChangesSend via e-MailPrintPermalink × read a file by line <?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); ?> See Also file_get_contents docs/programming/php/read_a_file_by_line.txt Last modified: 2009/02/09 22:14by billh