Hi,
As this bug was already marked as a documentation problem and
handled by Rasmus, but I don't think this is a problem of
that kind, because versions prior to 4.3.5 returns an array
that contains a null string element and the script supplied
by the user on bug #27730 had worked flawlessly.
I think this should also be addressed during the RC period
of 4.3.6.
Regards,
Moriyoshi
that kind, because versions prior to 4.3.5 returns an array
that contains a null string element and the script supplied
by the user on bug #27730 had worked flawlessly.
Here I mean: because in versions prior to 4.3.5 fgetcsv()
returns an array that contains a null string element for an
empty line..
Anyway, I might be a bit too late.
Moriyoshi
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
Uh, huh? The behaviour in 4.3.5 is the same as always. Nothing has
changed here. It was simple user error in that report.
-Rasmus
Hi,
As this bug was already marked as a documentation problem and
handled by Rasmus, but I don't think this is a problem of
that kind, because versions prior to 4.3.5 returns an array
that contains a null string element and the script supplied
by the user on bug #27730 had worked flawlessly.I think this should also be addressed during the RC period
of 4.3.6.Regards,
Moriyoshi