src/Language.php
private static function parseLanguage($code)
    {
        $lang = substr($code, 0, 2);
        foreach (self::codes() as $code) {
            if ($code['code'] == strtolower($lang)) {
                return [strtolower($lang), $code['description']];
            }
        }

        throw new UnknownLanguageCodeException(
            "The language code '{$code}'' is unknown."
        );
    }
private static function parseLanguage($code)
    {
        $lang = substr($code, 0, 2);
        foreach (self::codes() as $code) {
            if ($code['code'] == strtolower($lang)) {
                return [strtolower($lang), $code['description']];
            }
        }

        throw new UnknownLanguageCodeException(
            "The language code '{$code}'' is unknown."
        );
    }
private static function parseLanguage ( $ code ) { $ lang = substr ( $ code , 0 , 2 ) ; foreach ( self :: codes ( ) as $ code ) { if ( $ code [ 'code' ] == strtolower ( $ lang ) ) { return [ strtolower ( $ lang ) , $ code [ 'description' ] ] ; } } throw new UnknownLanguageCodeException ( "The language code '{$code}'' is unknown." ) ; }
Get language code

@param string $code

@return array
Get language code