php 如何把数据库中的数据 输出到 Excel
方法一:
<?php
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:attachment;filename=test_data.xls");
$tx='表头';
echo $tx."\n\n";
//输出内容如下:
echo "姓名"."\t";
echo "年龄"."\t";
echo "学历"."\t";
echo "\n";
echo "张三"."\t";
echo "25"."\t";
echo "本科"."\t";
?>
方法二: PHPEXCEL 类库,功能强大,支持win Excel2003 ,Win Excel2007.下载类库,里边有例子
上一篇:
mysql 如何用命令快速复制表