title: Show CSV rows in reverse order with PHP
body: <p>Trying to get this code to echo the rows it gets from the CSV file in reverse order. Any idea how to do this?</p>
  
  <pre><code>&lt;?php
  $row = 1;
  $FILE = "file.csv";
  
  if (($handle = fopen($FILE, "r")) !== FALSE) {
  
      while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
          $num = count($data);
  
          for ($c=0; $c &lt; $num; $c++) {
              if ($c == 0) $first = $data[$c];
              if ($c == 1) $second = $data[$c];
  
          }
  
      }
      fclose($handle);
  
  }
  ?&gt;
  </code></pre>