public static function getMimeType($filename)
	{
		$mime_types = static::getMimeTypes();
		
		$extension = pathinfo($filename, PATHINFO_EXTENSION);
    	$extension = strtolower($extension);
    	
		if (array_key_exists($extension, $mime_types)) {
            return $mime_types[$extension];
        } elseif (function_exists('finfo_open')) {
            $finfo = finfo_open(FILEINFO_MIME);
            $mimetype = finfo_file($finfo, $filename);
            finfo_close($finfo);
            return $mimetype;
        } 
        return 'application/octet-stream';
	}
public static function getMimeType($filename)
	{
		$mime_types = static::getMimeTypes();
		
		$extension = pathinfo($filename, PATHINFO_EXTENSION);
    	$extension = strtolower($extension);
    	
		if (array_key_exists($extension, $mime_types)) {
            return $mime_types[$extension];
        } elseif (function_exists('finfo_open')) {
            $finfo = finfo_open(FILEINFO_MIME);
            $mimetype = finfo_file($finfo, $filename);
            finfo_close($finfo);
            return $mimetype;
        } 
        return 'application/octet-stream';
	}
public static function getMimeType ( $ filename ) { $ mime_types = static :: getMimeTypes ( ) ; $ extension = pathinfo ( $ filename , PATHINFO_EXTENSION ) ; $ extension = strtolower ( $ extension ) ; if ( array_key_exists ( $ extension , $ mime_types ) ) { return $ mime_types [ $ extension ] ; } elseif ( function_exists ( 'finfo_open' ) ) { $ finfo = finfo_open ( FILEINFO_MIME ) ; $ mimetype = finfo_file ( $ finfo , $ filename ) ; finfo_close ( $ finfo ) ; return $ mimetype ; } return 'application/octet-stream' ; }
Get the mime-type of a file

@param string $filename The path to the file
@return string The mime type
Get the mime - type of a file