简体   繁体   English

在php中打开Word文档(.doc)

[英]opening a word document in php (.doc)

I want to open a .doc file and print out using php (or only count lines and words). 我想打开一个.doc文件,并使用php打印出来(或仅计算行数和单词数)。 I tried with the COM library, but it didn't work (I'm using linux server). 我尝试使用COM库,但是没有用(我使用的是Linux服务器)。 I also tried installing Antiword but it doesn't work, because in my server safe_mode=off and i can't change it. 我也尝试安装Antiword但无法正常工作,因为在我的服务器中safe_mode=off并且我无法更改它。 Are there any solution, how can I open and view this file or simple count how many lines or words does it have? 有什么解决方案,如何打开和查看此文件,或者简单地计算它有多少行或单词?

Install catdoc on your server and use shell_exec to invoke it. 在您的服务器上安装catdoc并使用shell_exec调用它。 With the converted plain text you can do your word and line counts. 使用转换后的纯文本,您可以计算单词和行数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM