I\'ve been bumping into a problem. I have a log on a Linux box in which is written the output from several running processes. This file can get really big sometimes and I ne
function readlastline()
{
$fp = @fopen("/dosmnt/LOGFILE.DAT", "r");
$pos = -1;
$t = " ";
while ($t != "\n") {
fseek($fp, $pos, SEEK_END);
$t = fgetc($fp);
$pos = $pos - 1;
}
$t = fgets($fp);
fclose($fp);
return $t;
}
Source: http://forums.devshed.com/php-development-5/php-quick-way-to-read-last-line-156010.html