title: Why is fgets + explode faster than fgetcsv?
body: <p>I need a quick line-by-line reading of a large csv file, with a partition of the fields into an array.
  The csv file has 100 thousand lines.</p>
  
  <pre><code>// Example 1, works in 3.5 seconds
  if(false !== $handle = fopen("data.csv", "r")) {
      while(($data = fgetcsv($handle, 0, ";"))) {
          $arData[] = $data;
      }
  }
  
  // Example 2, works in 0.3 seconds
  if(false !== $handle = fopen("data.csv", "r")) {
      while(($data = fgets($handle))) {
          $arData[] = explode(";", $data);
      }
  }
  </code></pre>
  
  <p>Why such a serious difference in speed? Or am I doing something wrong?</p>
  
  <p>The documentation says that <code>fgetcsv</code> is a similar function to <code>fgets</code>, except that it splits the result into an array.</p>