PHP function for generating CSV file.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • codexxx
    New Member
    • Jun 2007
    • 18

    PHP function for generating CSV file.

    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.

    Code:
    header("Content-type:text/octect-stream");
    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
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    yep in php 5+, fputcsv is there

    Comment

    Working...