Skip to content

Instantly share code, notes, and snippets.

@thewinterwind
Created February 9, 2014 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thewinterwind/8894152 to your computer and use it in GitHub Desktop.
Save thewinterwind/8894152 to your computer and use it in GitHub Desktop.
Read from a specific line to end of file using PHP
<?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