I have a file named file.txt which is update by adding lines to it.
file.txt
I am reading it by this code:
$fp = fopen(\"file.txt\", \"r\"); $da
If you're on a linux system you could do this:
$lines = `tail -5 /path/to/file.txt`;
Otherwise you'll have to count lines and take the last 5, something like:
$all_lines = file('file.txt'); $last_5 = array_slice($all_lines , -5);