php导入到Excel 的 utf8、gbk 编码_PHP教程
php导入到excel乱码是因为utf8编码在xp系统不支持所有utf8编码转码一下就完美解决了
utf-8编码案例
header("Content-Type: application/vnd.ms-excel; charset=UTF-8");
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition: attachment;filename=11.xls ");
header("Content-Transfer-Encoding: binary ");
?>
$filename="php导入到excel-utf-8编码";
$filename=iconv("utf-8", "gb2312", $filename);
echo $filename;
?>
gbk编码案例
header("Content-Type: application/vnd.ms-excel; charset=UTF-8");
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition: attachment;filename=11.xls ");
header("Content-Transfer-Encoding: binary ");
?>
$filename="php导入到excel-utf-8编码";
echo $filename;
?>
访问网站的时候就下载到excel里面
要弄单元格区别的话
用table表格做网页的就可以了
推荐阅读
-
php导入到Excel 的 utf8、gbk 编码_PHP教程
-
php将数据库导出成excel的方法_PHP教程
-
请教php怎么将utf-8编码的繁体转成gbk简体呢
-
PHP将Excel导入数据库及数据库数据导出至Excel的方法,excel数据导出_PHP教程
-
基于php导出到Excel或CSV的详解(附utf8、gbk 编码转换)
-
php使用mb_check_encoding检查字符串在指定的编码里是否有效_PHP教程
-
使用Yii框架php导入excel文件中的编码问题
-
php读取excel日期类型数据的例子_PHP教程
-
php的汉字转换:GBK至Unicode(UTF8)_PHP教程
-
php的汉字转换GBK-UnicodeUTF8_PHP教程