Hi, I'm just wondering how I can read a text file in php, I'd like to have it display the last 200 entries (their each on a new line) from the text file.
Like
John White Jane Does John Does Someones Name
and so on
Thanks!
Hi, I'm just wondering how I can read a text file in php, I'd like to have it display the last 200 entries (their each on a new line) from the text file.
Like
John White Jane Does John Does Someones Name
and so on
Thanks!
This outputs last 200 rows. Last row first:
$lines = file("filename.txt");
$top200 = array_slice(array_reverse($lines),0,200);
foreach($top200 as $line)
{
echo $line . "<br />";
}