Home >php教程 >php手册 >php快速生成excel文件技巧

php快速生成excel文件技巧

WBOY
WBOYOriginal
2016-06-21 08:57:50736browse

把以下代码放到php文件顶部,当前html页面大部分效果就会以excel的格式被保存下来,所见即所存,当然是大部分效果。

以下是PHP源码:
header("Pragma: public");
header("Pragma: no-cache");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=mydowns.xls");



Statement:
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