PHP export to excel
Posted
by
user1865240
on Stack Overflow
See other posts from Stack Overflow
or by user1865240
Published on 2012-11-30T05:01:07Z
Indexed on
2012/11/30
5:03 UTC
Read the original article
Hit count: 124
php
|export-to-excel
I'm having a trouble that I can't export japanese texts to excel (xls).
I used the following codes:
header('Content-type: application/ms-excel;charset=UTF-8');
header('Content-Disposition: attachment; filename='.$filename);
header("Pragma: no-cache");
echo $contents;
But in the excel file, the text changed to funny characters like this:
é™?定ç‰? ã?¨ã??ã?¯ã??ã?£ã?†ã?ªã?¢å??犬ã?®ã?Œæ??ã?
’è??ã??ã?Ÿã?†ã?£ã??ã??ã??ã?? ï??
Currently, I'm using hostingmanager and I tried on the different server using the same codes and there's no problem.
What could be the problem. Because of the PHP version?? Please help me.
Thank you, Aino
© Stack Overflow or respective owner