<1>添加header头来实现导入
<?php
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
echo "001"."\t"."tb"."\n";
echo "002"."\t"."wh"."\n";
?>
本文介绍了一种使用PHP语言导出简单Excel文件的方法。通过设置HTTP头部信息,可以将纯文本数据转换为Excel文件格式,并直接提供给浏览器下载。示例中包含了基本的数据输出,适用于快速创建简单的报表。
<1>添加header头来实现导入
<?php
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
echo "001"."\t"."tb"."\n";
echo "002"."\t"."wh"."\n";
?>
被折叠的 条评论
为什么被折叠?