Jump to content

Print to CSV problem


jaypotter

Recommended Posts

I am using the code below to send data to a csv file. When it displays in the file, then last column puts am " at the end of the column. I have tried to different variations of "\"\n" and I can't get it right. I have attached a screen shot of the csv file.  Any help is greatly appreciated.

 

    header("Content-type:text/octect-stream");

    header("Content-Disposition:attachment;filename=data.csv");

 

print 'Vendor,Name' . "\"\n";

print 'Vendor2,Name2' . "\"\n";

 

 

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/188456-print-to-csv-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.