Connecting Tech Pros Worldwide Help | Site Map

PHP function for generating CSV file.

Newbie
 
Join Date: Jun 2007
Posts: 14
#1: Oct 9 '09
Hi All,

In a recent interview in a company I was asked to tell the
a function name which generates CSV file . As I don't know
the answer so I wonder if there is any in-built function in PHP5
to create CSV file. Generally its done by manipulating the
header and setting it's content to a type like following.

Expand|Select|Wrap|Line Numbers
  1. header("Content-type:text/octect-stream");
  2. header("Content-Disposition:attachment;filename=data.csv");
So do please let me know if anything is available other than that.

Thanks and Regards
codexxx
ak1dnar's Avatar
Moderator
 
Join Date: Jan 2007
Location: Colombo
Posts: 1,439
#2: Oct 9 '09

re: PHP function for generating CSV file.


yep in php 5+, fputcsv is there
Reply


Similar PHP bytes