Created
February 9, 2014 04:11
-
-
Save thewinterwind/8894152 to your computer and use it in GitHub Desktop.
Read from a specific line to end of file using PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$log_file = 'lines.log'; | |
$read_start_position = 50; | |
$file = new SplFileObject($log_file); | |
$file->seek($read_start_position); | |
while(!$file->eof()) { | |
echo $file->current(); | |
$file->next(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment