I ran into a problem that SplFileObject’s fgetcsv method reads ” as part of the text and not as a cell end character
Example:
File:
;12;012345678;"foo";1;"100 000 000;"
;13;012345679;"bar";1;"100 000 000;"
Output:
(
[0] =>
[1] => 12
[2] => 012345678
[3] => foo";1;100 000 000
[4] =>
;13;012345679;bar"
[5] => 1
[6] => 100 000 000;
)
Code:
$file = new SplFileObject('1.txt');
$file->openFile();
$file->setCsvControl(';');
while ($str = $file->fgetcsv()) {
print_r($str);
}
Tell me, please, is it possible to force fgetcsv not to read “” as escaping?