how to get mime type using file name php code example Example: php get file mime type echo mime_content_type("yourfile.gif"); //image/gif