Sending a CSV file to the web browser with PHP

The headers look like so, substituting filename.csv for the name you would like: header('Content-type: application/octet-stream'); header('Content-Disposition: attachment; filename="filename.csv"');