getMimeType() public static method
Determines the MIME type of the specified file. This method will first try to determine the MIME type based on finfo_open. If the fileinfo extension is not installed, it will fall back to getMimeTypeByExtension() when $checkExtension is true.
public static string getMimeType ( $file, $magicFile = null, $checkExtension = true )$file string
The file name. $magicFile string
Name of the optional magic database file (or alias), usually something like /path