2023-05-12 开启多语言插件支持……

php将网页导出word文档

php 苏 demo 3358℃ 0评论

php导出word文档,实例代码如下:

<?php       
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;

?>

打赏

转载请注明:苏demo的别样人生 » php将网页导出word文档

   如果本篇文章对您有帮助,欢迎向博主进行赞助,赞助时请写上您的用户名。
支付宝直接捐助帐号oracle_lee@qq.com 感谢支持!
喜欢 (0)or分享 (0)