I am having problems reading a CSV file where the values are encapsulated in quotes.
The first line of my CSV file are headers and they look like the following:
"Header 1","Header 2","Header 3","Header 4","Header 5"
When using fgetcsv, the first header retains the surrounding quotes.
while (($row = fgetcsv($file, 6000, ',')) !== false)
{
echo '<pre>';
print_r($row);
echo '</pre>';
exit;
}
This outputs the following to the page
Array
(
[0] => "Header 1"
[1] => Header 2
[2] => Header 3
[3] => Header 4
[4] => Header 5
)
Does anyone have any advice on how to make sure the quotes are not included in the first array item?
Thanks