Modify a csv file line by line
问题 I have a big file that I want to modify every line in it. I want to use PHP to do it quickly : My file is CSV file ; 20010103,02,00,00,0.9496 20010103,03,00,00,0.9504 20010103,04,00,00,0.9499 I want to make it like this to be able to use it late with Highchart: [Date.UTC(2001,01,03,02,00,00),0.9496], [Date.UTC(2001,01,03,03,00,00),0.9504], [Date.UTC(2001,01,03,04,00,00),0.9499], How canI loop every line and make this modification ? 回答1: See the fgetcsv and fputcsv PHP functions. It will