<?

$filename = 'blah.csv';
$fp = fopen($filename, 'w');

$output = " a ";
$output .= " b ";
$output .= "\r\n";

fputs($fp, $output);

fclose($fp);