public static function getExtFromType($type, $primary = false) {
        $exts = array();

        foreach (self::$_types as $ext => $mimeType) {
            $isPrimary = false;

            if (is_array($mimeType)) {
                $mimeType = $mimeType[0];
                $isPrimary = $mimeType[1];
            }

            if ($mimeType == $type) {
                if ($primary && $isPrimary) {
                    return $ext;
                }

                $exts[] = $ext;
            }
        }

        if ($primary && isset($exts[0])) {
            return $exts[0];
        }

        return $exts;
    }
public static function getExtFromType($type, $primary = false) {
        $exts = array();

        foreach (self::$_types as $ext => $mimeType) {
            $isPrimary = false;

            if (is_array($mimeType)) {
                $mimeType = $mimeType[0];
                $isPrimary = $mimeType[1];
            }

            if ($mimeType == $type) {
                if ($primary && $isPrimary) {
                    return $ext;
                }

                $exts[] = $ext;
            }
        }

        if ($primary && isset($exts[0])) {
            return $exts[0];
        }

        return $exts;
    }
public static function getExtFromType ( $ type , $ primary = false ) { $ exts = array ( ) ; foreach ( self :: $ _types as $ ext => $ mimeType ) { $ isPrimary = false ; if ( is_array ( $ mimeType ) ) { $ mimeType = $ mimeType [ 0 ] ; $ isPrimary = $ mimeType [ 1 ] ; } if ( $ mimeType == $ type ) { if ( $ primary && $ isPrimary ) { return $ ext ; } $ exts [ ] = $ ext ; } } if ( $ primary && isset ( $ exts [ 0 ] ) ) { return $ exts [ 0 ] ; } return $ exts ; }
Return all extensions that have the same mime type.

@param string $type
@param bool $primary
@return array|string
static
Return all extensions that have the same mime type .