News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Daniel Cousineau's Blog:
Outputting CSV as a Downloadable File in PHP
October 13, 2008 @ 07:56:59

In a recent post to his blog Daniel Cousineau shows a method for correctly outputting CSV data in push down to the client browser as a method of export.

Nearly every application you could write in for the business sphere in PHP probably requires some sort of data export, most likely in the CSV format. The easiest way to provide a downloadable file is by altering the headers and echo'ing the file content.

His method sets the headers for the CSV file type then pushes the content out (contained in an array) via the fputcsv function. He wraps it all in a function near the end for simple cut and paste.

0 comments voice your opinion now!
output cvs data download fputcsv header


blog comments powered by Disqus

Similar Posts

Michael Girouard's Blog: FIEO with PHP 5 Interceptors

Zend Developer Zone: Zend Framework 1.0.4 Stable and 1.5RC1 Released

Tiffany Brown's Blog: Collecting e-commerce conversion data with Zen Cart and Google Analytics

Mike Wallner's Blog: Round Up

PHP-Coding-Practices.com: PHP Code-Beautifier Tool


Community Events





Don't see your event here?
Let us know!


opinion update package series podcast laravel introduction language interview unittest framework symfony api install library community deployment zendserver tips release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework