title: Live feed of an updating file
body: <p>I have a php file that prints the last 50 lines of a txt file. However, this file gets appended every second and would like to view a "live feed" of the action. How can this be done? This is the code for the php file:</p>
  
  <pre><code>&lt;?php
  $filename = '/home/duke/aa/servers/df/var/logs.log';  //about 500MB
  $output = shell_exec('exec tail -n50 ' . $filename);  //only print last 50 lines
  echo str_replace(PHP_EOL, '&lt;br /&gt;', $output);         //add newlines
  ?&gt;
  </code></pre>