ID:               32717
 Updated by:       [EMAIL PROTECTED]
 Reported By:      volf44 at yandex dot ru
-Status:           Open
+Status:           Bogus
-Bug Type:         *Programming Data Structures
+Bug Type:         Filesystem function related
 Operating System: Linux, Windows 2k
 PHP Version:      4.3.10
 New Comment:

Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.




Previous Comments:
------------------------------------------------------------------------

[2005-04-15 13:56:55] volf44 at yandex dot ru

Description:
------------
fgetcsv() incorrect handles single double quote
in first position of the last record field.

Reproduce code:
---------------
file test.csv:
one|record with bad double quote|"4
two|record with good "|4
[EOF]

$fd = fopen( 'test.csv', 'rb' );
while( $rec = fgetcsv( $fd, 20480, '|' )){
    var_dump( $rec );
}


Expected result:
----------------
array(3) {
  [0]=>
  string(3) "one"
  [1]=>
  string(28) "record with bad double quote"
  [2]=>
  string(1) ""4"
}
array(3) {
  [0]=>
  string(3) "two"
  [1]=>
  string(18) "record with good ""
  [2]=>
  string(1) "4"
}

Actual result:
--------------
array(4) {
  [0]=>
  string(3) "one"
  [1]=>
  string(28) "record with bad double quote"
  [2]=>
  string(24) "4
two|record with good "
  [3]=>
  string(1) "4"
}


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=32717&edit=1

Reply via email to