title: Read file lines backwards (fgets) with php
body: <p>I have a txt file that I want to read backwards, currently I'm using this:  </p>
  
  <pre><code>$fh = fopen('myfile.txt','r');
  while ($line = fgets($fh)) {
    echo $line."&lt;br /&gt;";
  }
  </code></pre>
  
  <p>This outputs all the lines in my file.<br>
  I want to read the lines from bottom to top.  </p>
  
  <p>Is there a way to do it?</p>