php导出word文档的代码

来源:互联网 发布:淘宝网团队 编辑:程序博客网 时间:2024/05/03 06:24
<?php/** * php导出word文档的代码 */header("Content-Type:application/msword");header("Content-Disposition:attachment;filename=doc.doc"); //指定文件名称 header("Pragma:no-cache");header("Expires:0");$html = '<table border="1" cellspacing="2" cellpadding="2" width="90%" align="center">';$html .= '<tr bgcolor="#cccccc"><td align="center">博客</td></tr>';$html .= '<tr bgcolor="#f6f7fa"><td><span style="color:#FF0000;"><strong>PHP将网页代码导出word文档</strong></span></td></tr>';$html .= '<tr><td align="center"><img src="/upload/header.gif" /></td></tr>'; //自定义图片文件$html .= '</table>';echo $html;?>

原创粉丝点击