php导入到Excel 的 utf8、gbk 编码
2010-03-03 15:56
381 查看
php导入到excel-支持utf8和gbk两种编码
php导入到excel乱码是因为utf8编码在xp系统不支持所有utf8编码转码一下就完美解决了
utf-8编码案例
<?php
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编码案例
<?php
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编码在xp系统不支持所有utf8编码转码一下就完美解决了
utf-8编码案例
<?php
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编码案例
<?php
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导入到Excel 的 utf8、gbk 编码
- [导入]PHP中gbK和UTF8编码处理
- PHP关于GBK格式写入utf8_general_ci 编码mysql数据库乱码的解决办法
- php导出到Excel 或 CSV (附utf8、gbk 编码转换)
- php截取字符串之截取utf8或gbk编码的中英文字符串示例
- [原创]PHP中GBK和UTF8编码处理
- php检测字符串编码(utf-8,gbk,gb2312)是否为utf8编码的方法总结
- PHP中GBK和UTF8编码处理
- php检测字符串编码(utf-8,gbk,gb2312)是否为utf8编码的方法总结
- 基于php导出到Excel或CSV的详解(附utf8、gbk 编码转换)
- 『PHP』UTF8编码页面存入GBK数据时使用iconv遇到无法转码的字符时中断内容丢失及解决方法
- mysql导入导出数据中文乱码解决方法小结(1、navicat导入问题已解决,创建连接后修改连接属性,选择高级->将使用Mysql字符集复选框去掉,下拉框选择GBK->导入sql文件OK;2、phpmyadmin显示乱码的问题也解决,两步:1.将sql文件以utf8的字符集编码另存,2.将文件中sql语句中的字段字符集编码改成utf8,导入OK)
- PHP中GBK和UTF8编码处理
- PHP中GBK和UTF8编码处理(转)
- PHP中GBK和UTF8编码处理
- PHP中GBK和UTF8编码处理
- php判断字符串的编码以及将字符串从GBK转换为UTF8字符集
- PHP中GBK和UTF8编码处理
- php导出到Excel 或 CSV (附utf8、gbk 编码转换)