Open the CSV file for appending (fopenDocs):
$handle = fopen("test.csv", "a");
Then add your line (fputcsvDocs):
fputcsv($handle, $line); # $line is an array of strings (array|string[])
Then close the handle (fcloseDocs):
fclose($handle);
I hope this is helpful.