I've just tried the script an both PHP 4.3.6, 4.2.3 and 5.0 return the same
results.
<?php
$fp = fopen("test.csv", 'w' );
fwrite( $fp, "one;val1\ntwo;val2\n\nthree;val3\n" );
fclose( $fp );
$fp = fopen("test.csv", 'r' );
$items = array( );
while( $d = fgetcsv( $fp, 4096, ';' ) ) {
var_dump($d);
}
fclose( $fp );
?>
Result:
array(2) {
[0]=>
string(3) "one"
[1]=>
string(4) "val1"
}
array(2) {
[0]=>
string(3) "two"
[1]=>
string(4) "val2"
}
array(1) {
[0]=>
string(0) ""
}
array(2) {
[0]=>
string(5) "three"
[1]=>
string(4) "val3"
}
Ilia
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php