setting header() for csv file
| From: | David T-G | Date: | Tue, 05 Aug 2003 21:43:54 +0000 |
| Subject: | setting header() for csv file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-158361@lists.php.net to get a copy of this message | ||
Hi, all --
I have a collection of files on disk which each contain a serialized
array. I currently loop through those and parse them to display the
values in a table, and now my client would like to additionally be able
to download the data in CSV format.
It's no big deal to change how I print the data, and in fact I now have a
very CSV-looking web page, but I realized as I was starting to switch
that I didn't know how to set the header so that it's recognized as a CSV
stream with some given filename. Unfortunately, I haven't yet found my
answer.
How do I construct the headers so that the browser says "Oh, this is a
CSV file, and here is its name; where shall I save it?" and the user
doesn't have to jump through any hoops?
TIA & HAND
:-D
--
David T-G * There is too much animal courage in
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!