Getting the type of remote file
You some time want to learn what type is the remote image, what is the length of remote file.
the only thing needed is a question to remote server and a receiver to answer our question.
That receiver is web server!
yes it is true!
you only need to gather the headers of question :
$headers = get_headers( 'http://www.example.com/?num=1');
Yes no one can guess what is that. Says that :
 => HTTP/1.1 200 OK
 => Date: Thu, 14 Oct 2010 09:46:18 GMT
 => Server: Apache/2.2
 => Last-Modified: Sat, 07 Feb 2009 16:31:04 GMT
 => ETag: "340011c-3614-46256a9e66200"
 => Accept-Ranges: bytes
 => Content-Length: 13844
 => Vary: User-Agent
 => Expires: Thu, 15 Apr 2020 20:00:00 GMT
 => Connection: close
 => Content-Type: image/png
Want any thing else?