ok so ive been trying to get this to work for hours now and cant figure it out. Ive got a csv file in the format of
item 1, item 1 stuff
item 2, item 2 stuff
item 3, item 3 stuff
item 4, item 4 stuff
and im trying to parse it into an array using fgetscsv.
$file = fopen('test.csv', 'r');
while (($MyCSVArray = fgetcsv($file)) !== FALSE) {
print_r($MyCSVArray);
}
fclose($file);
I would really rather parse it into an associative array so i can index it like so
MyCSVArray[item 1]
which would output
item 1 stuff
However the problem I am having is that since there isnt a comma after every value it groups item 1 stuff with item 2 like so
MyCSVArray[0] = item 1
MyCSVArray[1] = item 1 stuff item 2
MyCSVArray[2] = item 2 stuff item 3
Maybe I dont understand csv files or the csv function, but I really need this to work the way I want and dont understand how to make it work and am about to smash my face into my keyboard.