export to csv file in PHP, please help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
songbacdau
Forum Newbie
Posts: 1
Joined: Mon Aug 14, 2006 8:53 am

export to csv file in PHP, please help

Post by songbacdau »

I want to export data form database to csv file, but have a problem: my data in utf-8 charset, when i export to csv, it can't show in right unicode font. Please help me.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You may be able to use the header() function in conjunction with a content-type declaration.
jamiel
Forum Contributor
Posts: 276
Joined: Wed Feb 22, 2006 5:17 am
Location: London, United Kingdom

Post by jamiel »

How are you doing your export? You should be able to combine SELECT ... INTO OUTFILE with 'character_set_filesystem' in MySQL.
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Post by ddragas »

Post Reply