分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 前端开发

PHP生成excle文件

发布时间:2023-09-06 02:28责任编辑:苏小强关键词:PHP


excle_word.php

 ???????/*** ???* 生成excle文件 ???***/ ???$time = time(); ????$filename = date("Y年m月d日h点m分s秒", $time).'问卷数据'; ???$rows = ?Sp_Looks_Vote::downvote(); ???$file = $filename.".csv"; ???header('Content-Description: File Transfer'); ???header('Content-Type: application/octet-stream'); ?????header('Content-Disposition: attachment; filename='.basename($file)); ???header('Content-Transfer-Encoding: binary'); ???header('Expires: 0'); ???header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); ???header('Pragma: public'); ???$tabletitle .= "购买地址,常常购买,喜欢模特,内容如何,印象如何,是否购买,感觉如何,购买方式,购买方式建议,吸引点,改进建议"; ???$conter = iconv('utf-8','gbk',$tabletitle)."\n"; ???echo $conter;die; ???/*** ???* 生成word文件 ???***/ ???header("Content-Type: ??application/msword"); ???????????header("Content-Disposition: ??attachment; ??filename=doc.doc"); ???????????header("Pragma: ??no-cache"); ???????????header("Expires: ??0"); ???????????$output ???= ??'<table border="1" cellspacing="2" cellpadding="2" ?width="90%" align="center">'; ???????????$output ??.= ??'<tr bgcolor="#cccccc"><td ??align="center">图片</td></tr>'; ???????????$output ??.= ??'<tr bgcolor="#f6f7fa"><td><span style="color:#FF0000;"><strong>下面是一张图片</strong></span& gt;</td></tr>'; ???????????$output ??.= ??'<tr><td align="center"><img src="http://zi.csdn.net/48260_2.gif"></td></tr>'; ???????????$output ??.= ??'</table>'; ?????echo ??$output; ?????>

PHP生成excle文件

原文地址:https://www.cnblogs.com/datiangou/p/10199716.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved