求导出word/excel 思路 页面指定部分的内容在客户端导出到word/excel文件中并打开该文件。求教思路如何? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?php//如果包含图片文字,还不如直接生成PDF。在PHP手册中你可以很方便地参考PDF函数。$file_type = "vnd.ms-excel";$file_name = "test";$file_ending = "xls";header("Content-Type: application/".$file_type);header("Content-Disposition: attachment; filename=".$file_name.".".$file_ending);header("Pragma: no-cache");header("Expires: 0");print("Hello World!\n");print("\n");print("Item Name\tColor\tNumber\n");print("TV\tBlack\t6\n");print("Book\tWhite\t88\n");?> 如果要导出word里面包含样式和图片,很麻烦吗?我最近也遇到这个问题,我看见了一个,你可以参考,参考。http://www.cnitblog.com/CoffeeCat/archive/2009/04/08/47753.html用的时候注意编码 phpexcel这个软件很不错。配置好后可以利用函数直接生成excel,word和pdf,很方便的。你搜索下载一下。有问题再联系我。我已经配置成功并用的很好。 最笨的方法,你把php生成的html页面直接输出为word或者excel头。也可以输出为excel/wordheader("Content-Type: application/".$file_type);header("Content-Disposition: attachment; filename=".$file_name.".".$file_ending);header("Pragma: no-cache");header("Expires: 0");如果想excel好看,最好输出为table。 我要在织梦环境下 做个效果 在不同地区 访问同一个站点 显示的主页不一样 父子列表的array排序方法 请教jpgraph画饼图的问题 请教熟悉DISCUZX1.5二次开发的兄弟。 DEDECMS的一段求解释 分享一个php汉字拆分函数 100万条记录的文本文件,取出重复数最多的前10条。 nginx的alias用proxy转发 PHP网站怎么换了LINUX后模版标签不解析是怎么回事? 跟着做了一个简单的网页玩玩 csdn博客顶部的导航条太丑了 求一个最新的百度收录查询系统PHP版的
<?php
//如果包含图片文字,还不如直接生成PDF。在PHP手册中你可以很方便地参考PDF函数。$file_type = "vnd.ms-excel";
$file_name = "test";
$file_ending = "xls";header("Content-Type: application/".$file_type);
header("Content-Disposition: attachment; filename=".$file_name.".".$file_ending);
header("Pragma: no-cache");
header("Expires: 0");print("Hello World!\n");
print("\n");print("Item Name\tColor\tNumber\n");
print("TV\tBlack\t6\n");
print("Book\tWhite\t88\n");
?>
我最近也遇到这个问题,我看见了一个,你可以参考,参考。http://www.cnitblog.com/CoffeeCat/archive/2009/04/08/47753.html用的时候注意编码
你搜索下载一下。
有问题再联系我。
我已经配置成功并用的很好。
也可以输出为excel/wordheader("Content-Type: application/".$file_type);
header("Content-Disposition: attachment; filename=".$file_name.".".$file_ending);
header("Pragma: no-cache");
header("Expires: 0");如果想excel好看,最好输出为table。