php-8.0.30-src/ext/standard/tests/file/fgetcsv_variation32.phpt

31 lines
456 B
PHP

--TEST--
fgetcsv() with empty $escape
--FILE--
<?php
$contents = <<<EOS
"cell1","cell2\\","cell3","cell4"
"\\\\\\line1
line2\\\\\\"
EOS;
$stream = fopen('php://memory', 'w+');
fwrite($stream, $contents);
rewind($stream);
while (($data = fgetcsv($stream, 0, ',', '"', '')) !== false) {
print_r($data);
}
fclose($stream);
?>
--EXPECT--
Array
(
[0] => cell1
[1] => cell2\
[2] => cell3
[3] => cell4
)
Array
(
[0] => \\\line1
line2\\\
)