生成csv文件的header的设置

原创
2012/06/28 17:08
阅读数 1.3K
<?php
$csvContent = "qwe,qwe,qwe,qwe,qwe,qwe,qwe \n";
header("Content-Type: application/vnd.ms-excel; charset=GB2312");   
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数据.csv ");   
header("Content-Transfer-Encoding: binary ");
$csvContent = iconv("utf-8","gb2312",$csvContent);
echo $csvContent;
exit;
?>


展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部