CSV to JSON with PHP?

前端 未结 6 1444
遥遥无期
遥遥无期 2020-12-31 13:48

I need to convert a CSV file to JSON on the server using PHP. I am using this script which works:

function csvToJSON($csv)          


        
6条回答
  •  误落风尘
    2020-12-31 14:00

    I recommend using Coseva (a csv parsing library) and using the built in toJSON() method.

    parse();
    
    // disco
    echo $csv->toJSON();
    

提交回复
热议问题