I have a csv file with the following structure:
a; b; c,cc; d
When I try to process it, it says that offset 2 and 3 are undefined. It took a little time to understand that this is caused , and has no idea how to solve it. If I delete,, everything will be fine.
Here is my processing function:
function process_csv($file) { $file = fopen($file, "r"); $data = array(); while (!feof($file)) { $csvdata = fgetcsv($file); $data[] = explode(';', $csvdata[0]); } fclose($file); return $data; }
Tried fgetcsv($file); like fgetcsv($file, '"'); but didn't help.
php
Kiss Koppรกny
source share