F::mimeToExtension PHP Method

mimeToExtension() public static method

Converts a mime type to a file extension
public static mimeToExtension ( string $mime ) : string
$mime string
return string
    public static function mimeToExtension($mime)
    {
        foreach (static::$mimes as $key => $value) {
            if (is_array($value) && in_array($mime, $value)) {
                return $key;
            }
            if ($value == $mime) {
                return $key;
            }
        }
        return null;
    }