[php] 代码片段---csv 文件 header 头部信息

来源:互联网 发布:鹰视眼监控软件app 编辑:程序博客网 时间:2024/05/21 07:08
$csvFileName = "CSV数据.csv";$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=$csvFileName");   header("Content-Transfer-Encoding: binary ");$csvContent = iconv("utf-8","gb2312",$csvContent);echo $csvContent;exit;
原创粉丝点击