title: What is the best way to read last lines (i.e. "tail") from a file using PHP?
body: <p>In my PHP application I need to <strong>read multiple lines starting from the end of 
  many files</strong> (mostly logs). Sometimes I need only the last one, sometimes I need 
  tens or hundreds. Basically, I want something as flexible as the Unix <code>tail</code>
  command.</p>
  
  <p>There are questions here about how to get the single last line from a file (but
  I need <em>N</em> lines), and different solutions were given. I'm not sure about which 
  one is the best and which performs better.</p>