Use fputcsv() for proper csv encoding