PHP has no built in support for PDF files, so checking for "something" would be required, and is likely to fail unless you have installed it yourself.
I've never had to deal with reading pdf files, just creating them. However, my google skills got me trying a web search for "php read pdf file" and the first returned result seems like a good choice, assuming it works as advertised (which I don't doubt but havn't verified): http://davidwalsh.name/read-pdf-doc-file-php.
Note that an additional link click is required. Also note that it is a GNU license, which means that you can use it free of charge, but to redistribute (part of) the code as part of your own project, your own code also has to be GNU.