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?
Asked
Active
Viewed 8,954 times
2
-
Nobody has yet devoted their life and sanity to writing a single, all-encompassing library capable of reading all file formats known to man. Writing for any single one of these is more than enough work for the average developer. You'll have to make do with different packages for the different file types. – Mark Baker Feb 26 '11 at 18:56
-
I wasn't suggesting there was one all-encompassing library... I am just on a tight deadline and want to find the best way to accomplish this ahead of time. – JLZenor Feb 26 '11 at 20:04
-
I have .docx working, still trying to figure out the other formats. I cannot use COM because I am running it from a linux box. – JLZenor Mar 02 '11 at 21:50
4 Answers
7
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:
PDF Thread:

Community
- 1
- 1

Brandon Frohbieter
- 17,563
- 3
- 40
- 62
1
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.

Paul Creasey
- 28,321
- 10
- 54
- 90
0
I don't think there is native support for reading documents with PHP. Installing these packages is the only choice. :-)

Shoban
- 22,920
- 8
- 63
- 107
0
maybe this URL can help you:
where have: -PhPWord, -PhpSpreadsheet(instead of PhPExcel) ...

Ion Stefanache
- 147
- 1
- 4