Hi folks, What is the best way to read the last line in a text file, as in a list of user names?
Mucho grassy arse
Nick
For a relatively small file, something like this should work fine:
$lines = file($filename); $size = sizeof($lines); if ($size > 0) { $lastLine = chop($lines[$size-1]); }