How to find out extension of a file through its url?
<p>I am trying to find out what extensions a particular url has, Here is what I am trying to do:</p>

<pre><code>$pathinfo = pathinfo('http://imgur.com/9P54j');
$extension = $pathinfo['extension'];
echo $extension;
</code></pre>

<p>The url 'http://imgur.com/9P54j' is actually a url having 9P54j.gif image, and its not evident in the url, how do I extract the extension .gif of the the file '9P54j' ?</p>
