0
我生成Excel这样的:写入文件到服务器磁盘,而不是下载
<?php
$file="test.xls";
$test="<table border=1><tr><td>Cell 1</td><td>Cell 2</td></tr></table>";
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$file");
echo $test;
?>
它的工作出色。而不是它下载到客户端计算机,我可以写它到服务器中的文件夹?
file_put_contents ...? – bwoebi
上面的头文件使用['file_put_contents()'](http://uk.php.net/file_put_contents),下一次请在搜索之前搜索文档。 – HamZa
HTML!== XLS除非你有PHP的automagic扩展功能,可以从HTML标记中奇迹般地创建一个Excel BIFF文件 –