php查询结果导出到excel,PHP如何将查询出来的数据导出成excel表格

header("Content-type:application/vnd.ms-excel");

header("Content-Disposition:attachment; filename=查询信息表.xls");

//输出内容如下:

echo "序号"."\t";

echo "规章号"."\t";

echo "规章名称"."\t";

echo "关键字"."\t";

echo "级别"."\t";

echo "文件类型"."\t";

echo "专业类别"."\t";

echo "规章状态"."\t";

echo "起草单位"."\t";

echo "实施时间"."\t";

echo "\n";

$len = count($info);

for ( $i = 0; $i < $len; $i++ ) {

echo $info[$i]["files_id"]."\t";

echo $info[$i]["files_num"]."\t";

echo $info[$i]["files_title"]."\t";

echo $info[$i]["files_keyword"]."\t";

echo $info[$i]["fl_name"]."\t";

echo $info[$i]["ft_name"]."\t";

echo $info[$i]["fm_name"]."\t";

echo $info[$i]["fs_name"]."\t";

echo $info[$i]["files_unit"]."\t";

echo $info[$i]["files_impl_time"]."\t";

echo "\n";

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值