You can easily check mime type of an internet resource using this code :<?phpfunction getUrlMimeType($url) { $buffer = file_get_contents($url); $finfo = new finfo(FILEINFO_MIME_TYPE); return $finfo->buffer($buffer);}?>I'm using it to detect if an url given by a user is a HTML page (so I do some stuff with the HTML) or a file on Internet (so I show an icon accordingly to the mime type).