Submitted by NanoDano on Mon, 07/27/2015 - 19:45
This code will allow you to tail a file in PHP. It is cheating a little bit though because it is actually making a system call to tail, so you have to have tail installed. It is meant for Linux machines not Windows.
$handle = popen("tail -f /etc/httpd/logs/access.log 2>&1", 'r');
$buffer = fgets($handle);