生成excel 當(dāng)然使用的是 phpExcel這個類庫了,可是它太麻煩了,對于只要簡單生成來說有點不值得
什么叫簡單,把數(shù)據(jù)庫的數(shù)據(jù)導(dǎo)入到excel就行了, 這個就是簡單了
下面看一段代碼(代碼來自網(wǎng)絡(luò))
注意要雙引號的字符串
復(fù)制代碼 代碼如下:
<?php
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
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";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
?>
運行就會下載test.xls這個文件,打開以后他是這樣的