I am having a csv file with 1 email id in each line. I want to add comma after each email id. I want to add a comma to the end of each line using php. How can i do this? Is there a particular function for that?
UPDATE
I want this so that I can construct an array out of it in javascript.
I will be loading the csv file using php and then printing it in my js.
Like
var myCars=[<?php print $csv; ?>];
So that I acheive something like this.
var myCars=["Saab@gmail.com","Volvo@gmail.com","BMW@gmail.com"];
Or is there a better way to do this?
Why not use the csv-specific functions?
The above code will write a new csv, line per line, but if you just want to generate a javascript array, why not do this: