php-输出CSV文件

原创
2013/01/31 19:12
阅读数 138
<!-- lang: php -->
<?php
/*
 * Created on 2013-1-31
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
header("Content-Type: application/vnd.ms-excel; charset=GB18030");   
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=数据.csv ");   
header("Content-Transfer-Encoding: binary ");
$html = iconv("utf-8","gb18030",$html);
echo $html;
?>
展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部