phpnewbie112 Posted October 6, 2008 Share Posted October 6, 2008 Hello, I searched over the forum and on google for information regarding reading a .doc file under php but most of them refered to a COM that only works under Windows. Can anyone advice how can I read a .doc file in php and output the content. thanks Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted October 6, 2008 Share Posted October 6, 2008 What are you archiving to do? Just read the contents of the .doc and display it? If so just open it as you would with any file, eg $content = file_get_contents('path/to/file.doc'); However if you're wanting to modify its contents then this can only be done by COM AFAIK Quote Link to comment Share on other sites More sharing options...
phpnewbie112 Posted October 6, 2008 Author Share Posted October 6, 2008 the file_get_contents returns weird characters, all I need is to count to total words in the document. any idea? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted October 6, 2008 Share Posted October 6, 2008 The problem is the .doc is not just plain text. So you cant do a straight forward word count. Quote Link to comment Share on other sites More sharing options...
phpnewbie112 Posted October 6, 2008 Author Share Posted October 6, 2008 I know thats why I am seeking a way to read it as a plain text Quote Link to comment Share on other sites More sharing options...
trecool999 Posted October 6, 2008 Share Posted October 6, 2008 I suggest reading: Here and Here Quote Link to comment Share on other sites More sharing options...
phpnewbie112 Posted October 7, 2008 Author Share Posted October 7, 2008 thank you I will read the mentioned Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.