基本上一樣用 header 就可達到你要的xls檔
但我用的方法很賤 ^^
一、
將資料內容用依照html的方式輸出至網頁
二、
用header 用 輸出的html內容 直接存為 xls 檔
雖其 source code 是html
但用excel可以打開
因副檔名是xls
header :
if($type=="outport")
{
$fname = output.xls"; <- 指定匯出檔名
header ("Content-disposition: filename=$fname"); <- 指定匯出檔名
header("Content-type: application/octetstream");
header("Pragma: no-cache");
header("Expires: 0");
}
打完收功 呼~~
原文 : http://www.ecstart.com/forum/viewthread.php?tid=11406&extra=page%3D1
Add new comment