php-src/ext/spl/tests/SplFileObject_fgetcsv_enclosure_basic.phpt

32 lines
492 B
PHP

--TEST--
SplFileObject::fgetcsv with alternative delimeter
--FILE--
<?php
$fp = fopen('SplFileObject__fgetcsv.csv', 'w+');
fputcsv($fp, array(
'field1',
'field2',
'field3',
5
), ',', '"');
fclose($fp);
$fo = new SplFileObject('SplFileObject__fgetcsv.csv');
var_dump($fo->fgetcsv(',', '"'));
?>
--CLEAN--
<?php
unlink('SplFileObject__fgetcsv.csv');
?>
--EXPECTF--
array(4) {
[0]=>
string(6) "field1"
[1]=>
string(6) "field2"
[2]=>
string(6) "field3"
[3]=>
string(1) "5"
}