问题
I need to be able to read the text of many different file types in PHP, including .doc, .docx, excel, and PDF files. I found a few methods online that require installing multiple packages but I was wondering if there was a better way to do this?
回答1:
No matter which way you swing it, there is no way to kill all these birds with one stone.
Word Thread:
Reading/Writing a MS Word file in PHP
Excel Thread:
Reading an Excel file in PHP
PDF Thread:
Read pdf files with php
回答2:
office 2007 is very easy, just need to unzip them and read the xml files, older versions of office and pdf will need extra packages.
回答3:
I don't think there is native support for reading documents with PHP. Installing these packages is the only choice. :-)
来源:https://stackoverflow.com/questions/5129018/how-do-i-read-word-excell-and-pdf-docs-in-php