|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-04-18 15:23 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 10:00:01 2025 UTC |
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" }