Given the following string of CSV data (I am unable to ensure the fields are quoted)
AB,CD, EF,GH, IJ
and PHP code of:
$arr = fgetcsv($f);
(assuming $f is a valid file-pointer reading a file containing the above text) - one would expect this result:
Array('AB', 'CD', ' EF', 'GH', ' IJ');
when in fact you get:
Array('AB', 'CD', 'EF', 'GH', 'IJ');
This is problematic if you need positional context within that field.
Any workarounds of still being able to take advantage of fgetcsv, but ensuring that whitespace is not lost?
The bug is reported here: http://bugs.php.net/bug.php?id=53848