Read hidden extension of file from link
<p>I need to read pdf extension file from some links which I crawled from a web. The links is saved in <code>$link</code> variable.
but sometimes, the extension doesn't written in the link, for example : <code>http://tstc.bz/docs/490</code> besides 490 is a pdf file, the extension will exist when I click it. How to read that hidden extension ? thank you
I've tried using <code>PATHINFO</code> </p>

<pre><code>if (strtolower(pathinfo($link,PATHINFO_EXTENSION)) === 'pdf'){
</code></pre>
