生成excel文件,最简单的莫过于把数据库的数据导入到excel就行了。
生成excel 当然使用的是 phpExcel
http://www.jbxue.com/tags/phpexcel.html
这个类库了,可是它太麻烦了,对于只要简单生成来说有点不值得
什么叫简单,把数据库的数据导入到excel就行了,
这个就是简单了
注意,双引号的字符串
<?php
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
echo "test1\t";
echo "test2\t\n";
echo "test1\t"; // www.jbxue.com
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
?>
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
echo "test1\t";
echo "test2\t\n";
echo "test1\t"; // www.jbxue.com
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
?>