php,将数据库信息导入word中 我现在要做一个请假系统,目前要将数据库中的请假条信息导入word版的请假条,请高手指点 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?phpheader("Cache-Control: no-cache, must-revalidate");header("Pragma: no-cache");//有了这些,可以把带html标签的html源码导入到word里,并且可以保持html的样式。/* <STYLE>BR.page { page-break-after: always }</STYLE>在<head>部分加这个是为了实现打印的时候分页 */$wordStr = '<html xmlns:o="urn:schemas-microsoft-com:office:office"xmlns:w="urn:schemas-microsoft-com:office:word"xmlns="http://www.w3.org/TR/REC-html40"><head><STYLE>BR.page { page-break-after: always }</STYLE></head><body>'; $wordStr = "<b>hello</b><p>this is html code</p>"; $wordStr .= '</body></html>'; //防止导出乱码 $file = iconv("utf-8", "GBK", $filename); header("Content-Type: application/doc"); header("Content-Disposition: attachment; filename=" . $file . ".doc"); echo $wordStr;?> mysql用控制台突然无法登陆了 1045错误 困扰了我一天的小甜饼,求大神 如何让数据不要以科学计数法输出 关于缓存 php连接mssql的问题? 求高手 我怎么去掉网页后面的 网站标题 请问怎么提取这个子串,才鸟 zend的问题 PHP 连接MYSQL出现问题 打不开PHP文件,是怎么回事?在apache下,而不是在IIS下的 php的addcslashes的用法求助 使用phpexcel导出excel乱码
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
//有了这些,可以把带html标签的html源码导入到word里,并且可以保持html的样式。
/*
<STYLE>
BR.page { page-break-after: always }
</STYLE>
在<head>部分加这个是为了实现打印的时候分页
*/
$wordStr = '<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<STYLE>
BR.page { page-break-after: always }
</STYLE>
</head><body>'; $wordStr = "<b>hello</b><p>this is html code</p>"; $wordStr .= '</body></html>';
//防止导出乱码
$file = iconv("utf-8", "GBK", $filename); header("Content-Type: application/doc");
header("Content-Disposition: attachment; filename=" . $file . ".doc");
echo $wordStr;
?>