这是我的代码:
$word = new COM("word.application");
$word->Visible = 1;
$word->Documents->Open('./../Team.docx');
$filename = tempnam(sys_get_temp_dir(), "");
$word->Documents[1]->SaveAs($filename);
$word->quit();
unset($word);
//header("Content-type: application/vnd.ms-word");
//header("Content-Disposition: attachment;Filename=test.doc");
header('Content-Encoding: UTF-8');
header('Content-type: text/html; charset= UTF-8');
header("Content-Disposition: attachment;Filename=Test.html");
// Send file to browser
readfile($filename);
unlink($filename);
我的代码想知道将MsWord文件比SaveAs
文件读到HTML
文件中的新文件但它还不正确,任何人都有任何想法,请求建议我在PHP