$data = “Id, FirstName, LastName, Email, Phone, ZipCode”.”n”;
$data .= “1,’Test1′,’Test2′,’Test@gmail.com’,’546435′,’10001′”.”n”;
$myFile = “userinfo.csv”;
$fh = fopen($myFile, ‘a’) or die(“can’t open file”);
fwrite($fh, $data);
fclose($fh);
$data = “Id, FirstName, LastName, Email, Phone, ZipCode”.”n”;
$data .= “1,’Test1′,’Test2′,’Test@gmail.com’,’546435′,’10001′”.”n”;
$myFile = “userinfo.csv”;
$fh = fopen($myFile, ‘a’) or die(“can’t open file”);
fwrite($fh, $data);
fclose($fh);