You are here: Re: Output as csv « PHP Programming Language « IT news, forums, messages
Re: Output as csv

Posted by Geoff Berrow on 03/13/06 02:23

Message-ID: <a7k81294tbp938j1cj7oi6ng978q02476l@4ax.com> from Geoff
Berrow contained the following:

>header("Content-Type: text/csv");
>header("Content-Disposition: inline; filename=$_SESSION[table].csv ");

OK, I'm exporting CSV files nicely now but I wondered how other people
tackle the problem of the content containing quotes.

I'm exporting the data like this

"some data", "some more data", "yet more data"

Eventually the file will be imported into Access.

It occurred to me that if the data contained a double quote mark, then
the file could be messed up.

I've done a string replace and changed double quotes to single, but this
doesn't feel like a very elegant or satisfactory solution so I wondered
what other people do?

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация