Quantcast
Channel: PHP – Tejash Shah
Viewing all articles
Browse latest Browse all 10

Sending a CSV file to the web browser with PHP

$
0
0
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"');Then it's simply a matter of echo'ing out the CSV data to the web browser. Compressing the data with ob_gzhandler In order to cut down the amount of data actually transferred, it’s a good idea to use PHP’s […]

Viewing all articles
Browse latest Browse all 10

Trending Articles