I have a text file such as a log file, and I want to get the last 50 lines from that.
How can I do it, in PHP?
$data = file('yourfile.txt'); $lines = implode("\r\n",array_slice($data,count($data)-51,50)); ?>
As simple as this