src/Utilities/MimeTypes.php
public static function getExtensions(array $mimesTypes, $asUpperCase = false)
    {
        if (empty($mimesTypes)) {
            return [];
        }

        $extensions = [];

        foreach ($mimesTypes as $mimeType) {
            $extension = self::getExtension($mimeType);

            /*
             * No extension for given mime type?
             * Nothing to do
             */
            if (empty($extension)) {
                continue;
            }

            if ($asUpperCase) {
                if (is_array($extension)) {
                    array_walk($extension, function (&$value) {
                        $value = strtoupper($value);
                    });
                } else {
                    $extension = strtoupper($extension);
                }
            }

            $extensions[$mimeType] = $extension;
        }

        return $extensions;
    }
public static function getExtensions(array $mimesTypes, $asUpperCase = false)
    {
        if (empty($mimesTypes)) {
            return [];
        }

        $extensions = [];

        foreach ($mimesTypes as $mimeType) {
            $extension = self::getExtension($mimeType);

            /*
             * No extension for given mime type?
             * Nothing to do
             */
            if (empty($extension)) {
                continue;
            }

            if ($asUpperCase) {
                if (is_array($extension)) {
                    array_walk($extension, function (&$value) {
                        $value = strtoupper($value);
                    });
                } else {
                    $extension = strtoupper($extension);
                }
            }

            $extensions[$mimeType] = $extension;
        }

        return $extensions;
    }
public static function getExtensions ( array $ mimesTypes , $ asUpperCase = false ) { if ( empty ( $ mimesTypes ) ) { return [ ] ; } $ extensions = [ ] ; foreach ( $ mimesTypes as $ mimeType ) { $ extension = self :: getExtension ( $ mimeType ) ; /*
             * No extension for given mime type?
             * Nothing to do
             */ if ( empty ( $ extension ) ) { continue ; } if ( $ asUpperCase ) { if ( is_array ( $ extension ) ) { array_walk ( $ extension , function ( & $ value ) { $ value = strtoupper ( $ value ) ; } ) ; } else { $ extension = strtoupper ( $ extension ) ; } } $ extensions [ $ mimeType ] = $ extension ; } return $ extensions ; }
Returns extensions for given mimes types

@param array $mimesTypes  The mimes types, e.g. ['video/mpeg', 'image/jpeg']
@param bool  $asUpperCase (optional) If is set to true, extensions are returned as upper case. Otherwise - lower
case.
@return array
Returns extensions for given mimes types