Home > php教程 > php手册 > body text

php 生成excel xls文档

WBOY
Release: 2016-06-13 11:23:08
Original
853 people have browsed it

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对象

请注æ„

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!