2006-9-5 14:26
php店小二
[php]生成EXCEL下载文档
直接將內容輸出給瀏覽器下載
[code]
<?php
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=php_excel.xls");
echo "MontTuetWedtThutFritSattSun"
?>
[/code]
讀取已存在的檔案給瀏覽器下載
[code]
<?php
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=php_excel.xls");
readfile("excel/filename.xls");
?>
[/code]