php生成word的例子

发布时间:2020-07-11编辑:脚本学堂
php生成word的例子,有需要的朋友可以参考下。
复制代码 代码示例:
<?php
//生成word
header("Content-Type: application/msword");
header("Content-Disposition: attachment; filename="file.doc"");
?>
<html xmlns:w=”urn:schemas-microsoft-com:office:word”> <head>
<title><?php echo(rand());?></title>
<xml>
<o:DocumentProperties> <o:Author><?php echo(rand());?></o:Author> </o:DocumentProperties>
</xml>
<style>
h1{font:16pt arial,sans-serif} p{font:12pt arial,sans-serif}
</style>
</head>
<body>
<div> <h1><o:p><?php echo(rand());?></o:p></h1>
<p><o:p><?php echo(rand());?></o:p></p>
</div>
</body>
</html>

您可能感兴趣的文章:
php导出word格式文档的实例代码
php生成excel或word文档的最简单方法
php生成word文档(读取数据库)
php生成word最简单的例子
php使用phpword生成word文档的例子
php生成word文件的简单范例
php 生成 导出word(可包含图片)的代码
php使用phpword生成word文档