I have to parse a file on my server that is comma separated, and I'm having trouble getting fgets or fgetcsv to parse just one line at a time. An example of the file I need to parse:
"Dog","Cat","Mouse"
"Chocolate","Carob","White Chocolate"
"Lime", "Lemon","Mango"
Could the problem be that my file does not have correct newline caracter at the end of each line? Or that there is no comma after the last entry on each line?
What I need-
1) Parse each line, one at a time.
2) Get rid of quotes
3) Dump the line into an array
4) Insert into database
I need help with 1 and 2 above...