 <p>You've got a difficult task there. <code>.doc</code> <code>.pdf</code> and <code>.xls</code> are not simply readable. To test this try opening a pdf with a basic text editor like <code>notepad</code> or <code>gedit</code>. You will see what appears to be gibberish. This is the same thing PHP sees when you read a file's contents.</p> <p><code>.xls</code> and <code>.doc</code> can probably be parsed with PHPWord and PHPExcel from <a href="https://github.com/PHPOffice" rel="nofollow">PHPOffice</a>. You will need to look in to these libraries. I don't know anything for PDFs but there's probably something. </p> <p>I would suggest writing a series of classes that all implement a similar interface so you can switch them out depending on the extension.</p>