title: fgetcsv not reading enclosures
body: <p>I am trying to read a CSV line using <code>fgetcsv</code>. However it seem not to care at all about enclosures.</p>
  
  <p>Here is what the line looks like:</p>
  
  <pre><code>Super Administrator,"ROLE_SUPER_ADMIN, ROLE_GROUP_GUEST, ROLE_GROUP_WRITER, ROLE_USER_WRITER, ROLE_USER_GUEST"
  </code></pre>
  
  <p>This is a valid line by CSV standards, and it should return the following with <code>"</code> as the enclosure and <code>,</code> as the delimiter:</p>
  
  <pre><code>$l = fgetcsv($handle, 0, ',', '"');
  array(
      [0] =&gt; 'Super Administrator',
      [1] =&gt; 'ROLE_SUPER_ADMIN, ROLE_GROUP_GUEST, ROLE_GROUP_WRITER, ROLE_USER_WRITER, ROLE_USER_GUEST',
  );
  </code></pre>
  
  <p>However this is what I get:</p>
  
  <pre><code>$l = fgetcsv($handle, 0, ',', '"');
  array(
      [0] =&gt; 'Super Administrator',
      [1] =&gt; '"ROLE_SUPER_ADMIN',
      [2] =&gt; ' ROLE_GROUP_GUEST',
      [3] =&gt; ' ROLE_GROUP_WRITER',
      [4] =&gt; ' ROLE_USER_WRITER',
      [5] =&gt; ' ROLE_USER_GUEST"',
  );
  </code></pre>
  
  <p>So yeah, it seems <code>fgetcsv</code> is right-out ignoring completely the enclosure character. I tried to get it working using <code>fgets</code> and then <code>str_getcsv</code> but the result is the same - <code>str_getcsv</code> is most probably called by <code>fgetcsv</code> for the CSV conversion anyway.</p>
  
  <p>I figured it could be some sort of regression bug that found its way in the PHP version I'm using, so I'm pasting the result of a <code>php -v</code> command here:</p>
  
  <pre><code>me@linux:~/$ php -v
  PHP 5.5.27-1+deb.sury.org~trusty+1 (cli) (built: Jul 15 2015 12:14:44) 
  Copyright (c) 1997-2015 The PHP Group
  Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
      with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
  </code></pre>
  
  <p>I believe this is the latest version of PHP5 at the moment I'm writing this. Although I suspect this is some kind of PHP bug, it could also be some installation/configuration problem, hence why I'm publishing this question.</p>
  
  <p>Has anyone already experienced this?
  What is the best way to solve this problem?</p>
  
  <p><strong>EDIT:</strong><br>
  As pointed out by Mark Baker, PHP5.5.27-1 is actually the latest revision of PHP5.5 at the time being.</p>
  
  <p><strong>EDIT 2:</strong><br>
  Here is an attempt with the <code>bin2hex</code> function, displayed with a <code>var_dump</code>.</p>
  
  <p>Line read <code>",",","</code> (2 cells containing only a coma in each cell): <code>0022002c0022002c0022002c0022000a</code>.</p>
  
  <p>With <code>bin2hex('"')</code> the result is just <code>22</code>.</p>
  
  <p><code>str_getcsv</code> still gives me this error though.</p>