当前位置:Gxlcms > PHP教程 > php生成csv文件header设置参考

php生成csv文件header设置参考

时间:2021-07-01 10:21:17 帮助过:49人阅读

  1. $csvContent = "qwe,qwe,qwe,qwe,qwe,qwe,qwe /n";
  2. header("Content-Type: application/vnd.ms-excel; charset=GB2312");
  3. header("Pragma: public");
  4. header("Expires: 0");
  5. header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  6. header("Content-Type: application/force-download");
  7. header("Content-Type: application/octet-stream");
  8. header("Content-Type: application/download");
  9. header("Content-Disposition: attachment;filename=CSV数据.csv ");
  10. header("Content-Transfer-Encoding: binary ");
  11. $csvContent = iconv("utf-8","gb2312",$csvContent);
  12. echo $csvContent;
  13. exit;
  14. ?>

更多内容,请参考: PHP header函数用法举例 php header函数用法详解举例(2) php header函数用法举例(1) php中header函数的用法举例详解 php header 使用详解 php header头信息应用举例 php生成csv文件

人气教程排行