News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
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



Similar Posts

DevShed: Iterators in the Simplest Sense - Traversing Data Structures in PHP 5

Community News: TestFest 2008

Secunia.com: Mandriva update for PHP

Tobias Schlitt's Blog: Taint mode for PHP?

Ken Guest's Blog: Book review: PHP Objects, Patterns and Practice (second edition)


Community Events









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


example application job database releases security PHP5 mysql release zendframework PEAR book conference developer package ajax code framework cakephp zend

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