php read CSV with various amount of delimiters
- by jreed121
I've got a script that reads in from a CSV file and sometimes the CSV files it receives contains an uneven amount of delimiters/columns so the first row could have 30 columns, the 2nd could have 20, etc. I can think of a few solutions myself ie:
Count the delimiters in the widest row, then append the proper amount to each row that is short to make them even.
But I was wondering if anyone had a more elegant method of doing this.