I want to open a .doc file and print out using php (or only count lines and words). I tried with the COM library, but it didn't work (I'm using linux server). I also tried installing Antiword
but it doesn't work, because in my server safe_mode=off
and i can't change it. 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. With the converted plain text you can do your word and line counts.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.