title: PHP reading csv, issue with double quotes
body: <p>I have a csv file that has 6 lines like the following :</p>
  
  <pre><code>10264,dan,Dan,37519,MILLER,6/3/2014 14:51,$28.40,Rapid,Dan@Cold.com,,
  10443,Dari,"D. R, LLC",37308,SELLERS,6/2/2014 15:12,$40.00,esponse,chards@lobal.net,,
  10488,EmHern,"A HOME FOR YOU,LLC",37749,MILLER,6/1/2014 8:23,$33.00, Response,23@YAHOO.COM,,
  </code></pre>
  
  <p>I trying to read that csv and extract some columns then add a pipe delimiter to each column extracted, here is the function I used :</p>
  
  <pre><code>&lt;?php
  function fncReadCSV($csvFileName){
      $result = array();
      $row = 1;
      if (($handle = fopen($csvFileName, "r")) !== FALSE) {
              while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
                  $outPut = "";
                  $outPut .= $data[0];
                  $outPut .="|";
                  $outPut .= $data[1];
                  $outPut .="|";  
                  $outPut .= $data[2];
                  $outPut .="|";  
                  $outPut .= $data[6];
                  $outPut .="|";  
                  $outPut .= $data[8];
                  $outPut .="|";                                  
                  array_push($result, rtrim($outPut, "|"));
                  $row++;
              }               
             }
      fclose($handle);
      return $result;
      }
  echo "&lt;pre&gt;";
  print_r(fncReadCSV("file.csv"));
  echo "&lt;/pre&gt;";
  </code></pre>
  
  <p>the result I get is correct for only the first  row, for the 2nd, 3rd rows I get the full row as it is in the csv, I'm expecting the quotes to break my code how can I fix that with a code that works for csv files with quotes present and csv files without please?</p>
  
  <p>the result is :</p>
  
  <pre><code>Array
  (
      [0] =&gt; 10264|dan|Dan|$28.40|Dan@Cold.com
      [1] =&gt; 10443,Dari,"D. R, LLC",37308,SELLERS,6/2/2014 15:12,$40.00,esponse,chards@lobal.net,,
      [2] =&gt; 10488,EmHern,"A HOME FOR YOU,LLC",37749,MILLER,6/1/2014 8:23,$33.00, Response,23@YAHOO.COM,,
  )
  </code></pre>
  
  <p>the result I'm expecting is :</p>
  
  <pre><code>Array
      (
          [0] =&gt; 10264|dan|Dan|$28.40|Dan@Cold.com
          [1] =&gt; 10443|Dari|"D. R, LLC"|esponse|chards@lobal.net
          [2] =&gt; 10488|EmHern|"A HOME FOR YOU,LLC"|37749|23@YAHOO.COM
      )
  </code></pre>