【发布时间】:2018-02-06 06:23:12
【问题描述】:
这是我的example.php,使用它我正在生成一个 example.doc 文件并使用标题我可以将该文件保存在我的本地计算机中。
但我想在 report 文件夹中再保存一份(report 和 example.php 在同一个文件夹/同一个域中)
<?php
$html = preg_replace('%/[^\\s]+\\.(jpg|jpeg|png|gif)%i', 'http://www.asd.com\\0', $html);
print "<html xmlns:v=\"urn:schemas-microsoft-com:vml\"";
print "xmlns:o=\"urn:schemas-microsoft-com:office:office\"";
print "xmlns:w=\"urn:schemas-microsoft-com:office:word\"";
print "xmlns=\"http://www.w3.org/TR/REC-html40\">";
print "<xml>
<w:WordDocument>
<w:View>Print</w:View>
<w:DoNotHyphenateCaps/>
<w:PunctuationKerning/>
<w:DrawingGridHorizontalSpacing>9.35 pt</w:DrawingGridHorizontalSpacing>
<w:DrawingGridVerticalSpacing>9.35 pt</w:DrawingGridVerticalSpacing>
</w:WordDocument>
</xml>
";
print '<h1>hello world</h1>';
header( 'Content-Type: application/msword' );
header("Content-disposition: attachment; filename=example.doc");
?>
【问题讨论】: