|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-03-28 12:03 UTC] rasmus@php.net
[2004-03-28 12:11 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 11:00:01 2025 UTC |
Description: ------------ fgetcsv() breaks reading when a line has no cdata (eg. \n\n) Reproduce code: --------------- <?php $fn = tempnam( '/tmp', 'test' ); if( $fp = fopen( $fn, 'w' ) ) { fwrite( $fp, "one;val1\ntwo;val2\n\nthree;val3\n" ); fclose( $fp ); if( $fp = fopen( $fn, 'r' ) ) { $items = array( ); while( $d = fgetcsv( $fp, 4096, ';' ) ) { $items[] = $d; } fclose( $fp ); var_dump( $items ); } } ?> Expected result: ---------------- $items-count of 4 Actual result: -------------- $item-count of 2