PHP: Array to CSV Converter

           function exportCSV($data=array()){
		$file = fopen("reports.csv","w");
		foreach ($data as $line){
		  fputcsv($file,$line);
		  }
		fclose($file);
		}