$handle = fopen("test.csv", "a"); fputcsv($handle, $line); # $line is an array of strings (array|string[]) fclose($handle);