Home >php教程 >php手册 >php 生成excel xls文档

php 生成excel xls文档

WBOY
WBOYOriginal
2016-06-13 11:23:08921browse

php教程 生成excel xls文档

方法1 - 使用HTTP头

至于在MS Word中所述,您需要格式化的HTML / PHP页面使用Excel友好CSS和标头信息

添加到您的PHP脚本。
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment;Filename=document_name.xls");

echo "";
echo "";
echo "

";
echo "testdata1 t testdata2 t n ";
echo "";
echo "";
?>

方法2 - 使用COM对象

请注æ„

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn