To add a line to the end of a CSV file using PHP simply use this code:
$array = ['Each', 'item', 'is', 'a', 'column'];
$handle = fopen('file.csv', 'a');
fputcsv($handle, $array);
fclose($handle);

To add a line to the end of a CSV file using PHP simply use this code:
$array = ['Each', 'item', 'is', 'a', 'column'];
$handle = fopen('file.csv', 'a');
fputcsv($handle, $array);
fclose($handle);