I need to convert a CSV file to JSON on the server using PHP. I am using this script which works:
function csvToJSON($csv)
I recommend using Coseva (a csv parsing library) and using the built in toJSON() method.
parse(); // disco echo $csv->toJSON();