I don't believe that there's some magical way to do it. You just have to continouslycontinuously poll the file size and output any new data. This is actually quite easy, and the only real thing to watch out for is that file sizes and other stat data is cached in php. The solution to this is to call clearstatcache()clearstatcache() before outputting any data.
Here's a quick sample, that doesn't include any error handelinghandling:
function follow($file) { $size = 0; while (true) { clearstatcache(); $currentSize = filesize($file); if ($size == $currentSize) { usleep(100); continue; } $fh = fopen($file, "r"); fseek($fh, $size); while ($d = fgets($fh)) { echo $d; } fclose($fh); $size = $currentSize; } } follow("file.txt");