I suppose I could call tail, but that would mean depending on an external program. Is there a way to do this in an efficient way using only PHP?
Update: For those interested, I followed the advice I got in the accepted answer and tried to implement on myself. Put it on my blog =)
You’d have to reproduce
tail, basically. Open the file, jump to the end, then start reading backwards. Read a chunk, count line breaks, repeat until linebreak count > number of lines desired, then dump out everything from that one linebreak onwards.