get_content_type()
Discover MIME type of a file based on contents
guess_content_type()
Guess MIME type from filename (extension)
simplemagic_mime_db
File extension-to-MIME mapping data frame
wand
Retrieve 'Magic' Attributes from Files and Directories