Home >Backend Development >PHP Tutorial > 怎样用php读取word2007,然后显示到网页下呢

怎样用php读取word2007,然后显示到网页下呢

WBOY
WBOYOriginal
2016-06-13 12:55:151011browse

怎样用php读取word2007,然后显示到网页上呢
如题 


------解决方案--------------------
<br />
<br />
<?php<br />
$word = new COM("word.application") or die ("Could not initialise MS Word object.");<br />
$word->Documents->Open(realpath("Sample.doc"));<br />
<br />
// Extract content.<br />
$content = (string) $word->ActiveDocument->Content;<br />
<br />
echo $content;<br />
<br />
$word->ActiveDocument->Close(false);<br />
<br />
$word->Quit();<br />
$word = null;<br />
unset($word);<br />
?><br />
<br />

------解决方案--------------------
不是好像,就是不行的!
------解决方案--------------------
用FlexPaper +swftools 就可以,我最近在搞这个
------解决方案--------------------
2007为个么不行啊,
------解决方案--------------------
用1楼的方法,就可以,但服务器上要装OFFICE2007或以上版本,又或者装OFFICE2003+微软的2007兼容包,就可以了,我两种方法都能成功读取DOCX!
------解决方案--------------------
用phpword
------解决方案--------------------
 用phpexcel类不行吗?
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn