From: thomas303 at web dot de Operating system: Suse Linux 8.2 PHP version: 4.3.3 PHP Bug Type: Filesystem function related Bug description: fgetcsv does net get all lines
Description: ------------ Hi, I use the function fgetcsv, but it imported only 17860 of 20900 rows. Tried \r\n and \n. I found out, that rows are missing in between of the file, not at the beginning or the end. When I import only these rows (grepped before), everything works fine. It imports some rows, misses one, imports some and so on. The error occured the last days without a change in file structure or php. It could be the data itself which leads to the error. I can't reproduce it nor can I send you the file because of data protection reasons. With fgets and explode everything is fine again. You should check against if fgetcsv works the same way or map fgetcsv to fgets and explode. Reproduce code: --------------- $fields=fgetcsv($fp,4096,"|"); with loop and so on. Expected result: ---------------- $fields=fgetcsv($fp,4096,"|"); should work exactly the same as $newline=fgets($fp,4096); $fields=explode("|", $newline); -- Edit bug report at http://bugs.php.net/?id=26510&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26510&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26510&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=26510&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=26510&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=26510&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=26510&r=needscript Try newer version: http://bugs.php.net/fix.php?id=26510&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=26510&r=support Expected behavior: http://bugs.php.net/fix.php?id=26510&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=26510&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=26510&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=26510&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26510&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=26510&r=dst IIS Stability: http://bugs.php.net/fix.php?id=26510&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=26510&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=26510&r=float