excel_class.php哪位前辈用过?导出出现乱码怎么回事。除此以外,换成最简单的php导出程序,如<?php
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:attachment;filename=test_data.xls");$tx='表头';
mb_convert_encoding($tx,"gbk","utf-8");
echo $tx."\n\n";
//输出内容如下:
echo "姓名"."\t";
echo "年龄"."\t";
echo "学历"."\t";
echo "\n";
echo "张三"."\t";
echo "25"."\t";
echo "本科"."\t";
;?>也出现乱码,怎么解决,大侠们
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:attachment;filename=test_data.xls");$tx='表头';
mb_convert_encoding($tx,"gbk","utf-8");
echo $tx."\n\n";
//输出内容如下:
echo "姓名"."\t";
echo "年龄"."\t";
echo "学历"."\t";
echo "\n";
echo "张三"."\t";
echo "25"."\t";
echo "本科"."\t";
;?>也出现乱码,怎么解决,大侠们
echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);
return;
}
function xlsEOF() {
echo pack("ss", 0x0A, 0x00);
return;
}
function xlsWriteNumber($Row, $Col, $Value) {
echo pack("sssss", 0x203, 14, $Row, $Col, 0x0);
echo pack("d", $Value);
return;
}
function xlsWriteLabel($Row, $Col, $Value ) {
$L = strlen($Value);
echo pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L);
echo $Value;
return;
}
这是excel_class.php里面的文件,怎么 解释,编码问题啊
答案是否定的
另外建议使用php-excel这个优秀的开源EXCEL来做EXCEL相关操作
header("Content-Type: application/vnd.ms-excel;");
header("Content-Disposition:filename=".$file_name.".xls");
echo iconv("UTF-8", "gb2312","姓名")."\t";
echo iconv("UTF-8", "gb2312","性别")."\t";