|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-12-15 12:59 UTC] tgallagher at kalos-inc dot com
[2003-12-15 13:50 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 05:00:01 2025 UTC |
Description: ------------ Using this sample.txt file with fgetcsv (tab delimited) " " "" "971221" "1" " " "" "950707" "\\ \\" " " "" "999637" "ERYC 250" on the middle record I get instead of 3 records, I get 7. instead of 3 records I get 2. record 1 is read correctly, records 2 and 3 run together. if I put a space at the beginning of the line with the double back slash it works. after searching the bug database I believe this error has not been reported. please correct me if this is not a bug. Reproduce code: --------------- <?PHP $fileHandle = fopen("sample.txt", "r"); while ($data = @fgetcsv ($fileHandle, 5000, "\t")) { print_r($data); } ?> Expected result: ---------------- Array ( [0] => [1] => [2] => 971221 [3] => 1 ) Array ( [0] => [1] => [2] => 950707 [3] => \\ \\" Array ( [0] => [1] => [2] => 999637 [3] => ERYC 250 ) Actual result: -------------- Array ( [0] => [1] => [2] => 971221 [3] => 1 ) Array ( [0] => [1] => [2] => 950707 [3] => \\ \\" [4] => [5] => 999637 [6] => ERYC 250 )