Home > Backend Development > PHP Tutorial > Settings for header to generate csv file_PHP tutorial

Settings for header to generate csv file_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:52:23
Original
1823 people have browsed it

01  02 $csvContent = "qwe,qwe,qwe,qwe,qwe,qwe,qwe n";
03 header("Content-Type: application/vnd.ms-excel; charset=GB2312"); 
04 header("Pragma: public"); 
05 header("Expires: 0"); 
06 header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
07 header("Content-Type: application/force-download"); 
08 header("Content-Type: application/octet-stream"); 
09 header("Content-Type: application/download"); 
10 header("Content-Disposition: attachment;filename=CSV数据.csv "); 
11 header("Content-Transfer-Encoding: binary ");
12 $csvContent = iconv("utf-8","gb2312",$csvContent);
13 echo $csvContent;
14 exit;
15 ?>

 

作者:张大鹏

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/478127.htmlTechArticle01?php 02$csvContent = qwe,qwe,qwe,qwe,qwe,qwe,qwe n; 03header(Content-Type: application/vnd.ms-excel; charset=GB2312); 04header(Pragma: public); 05header(Expires: 0); 06header(Ca...
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template