title: PHP fgetcsv not getting correct number of rows
body: <p>I have a rather large csv file (17GB) which I'm trying to sanity check. I've written a little script which looks like this:</p>
  
  <pre><code>#!/usr/bin/php
  &lt;?php
  
  $f = fopen($argv[1],'r');
  
  $i=0;
  while (!feof($f)) {
          $row = fgetcsv($f);
          $i++;
  }
  print $i."\n";
  
  ?&gt;
  </code></pre>
  
  <p>Which should just read in the number of rows and print it out. This script outputs:
  60770881</p>
  
  <p>But if I do a <code>wc -l</code> the result is 60777200.</p>
  
  <p>My csv file was generated from MySQL using:</p>
  
  <pre><code>INTO OUTFILE '/tmp/file.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n'
  </code></pre>
  
  <p>So it shouldn't have any unescaped newlines or anything like that. Does anyone have any idea what could be wrong?</p>