Locale::filterMatches
locale_filter_matches
(No version information available, might be only in CVS)
locale_filter_matches — Checks if a $langtag filter matches with $locale according to
Описание
Object oriented style
static
boolean
Locale::filterMatches
( string $langtag
, string $locale
)
Procedural style
boolean
locale_filter_matches
( string $langtag
, string $locale
)
Checks if a $langtag filter matches with $locale according to RFC 4647's basic filtering algorithm
Список параметров
- langtag
-
The language tag to check
- locale
-
The language range to check against
Возвращаемые значения
TRUE if $locale matches $langtag FALSE otherwise.
Примеры
Пример #1 locale_filter_matches() example
<?php
echo (locale_filter_matches('de-DEVA','de-DE', false)) ? "Matches" : "Does not match";
echo '; ';
echo (locale_filter_matches('de-DE_1996','de-DE', false)) ? "Matches" : "Does not match";
?>
Пример #2 OO example
<?php
echo (Locale::filter_matches('de-DEVA','de-DE', false)) ? "Matches" : "Does not match";
echo '; ';
echo (Locale::filter_matches('de-DE-1996','de-DE', false)) ? "Matches" : "Does not match";
?>
Результат выполнения данного примера:
Does not match; Matches
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Поддержка языков и кодировок
- Internationalization Functions
- Функция Locale::acceptFromHttp() - Tries to find out best available locale based on HTTP "Accept-Language" header
- Функция Locale::canonicalize() - Canonicalize the locale string
- Функция Locale::composeLocale() - Returns a correctly ordered and delimited locale ID
- Функция Locale::filterMatches() - Checks if a language tag filter matches with locale
- Функция Locale::getAllVariants() - Gets the variants for the input locale
- Функция Locale::getDefault() - Gets the default locale value from the INTL global 'default_locale'
- Функция Locale::getDisplayLanguage() - Returns an appropriately localized display name for language of the inputlocale
- Функция Locale::getDisplayName() - Returns an appropriately localized display name for the input locale
- Функция Locale::getDisplayRegion() - Returns an appropriately localized display name for region of the input locale
- Функция Locale::getDisplayScript() - Returns an appropriately localized display name for script of the input locale
- Функция Locale::getDisplayVariant() - Returns an appropriately localized display name for variants of the input locale
- Функция Locale::getKeywords() - Gets the keywords for the input locale
- Функция Locale::getPrimaryLanguage() - Gets the primary language for the input locale
- Функция Locale::getRegion() - Gets the region for the input locale
- Функция Locale::getScript() - Gets the script for the input locale
- Функция Locale::lookup() - Searches the language tag list for the best match to the language
- Функция Locale::parseLocale() - Returns a key-value array of locale ID subtag elements.
- Функция Locale::setDefault() - sets the default runtime locale
Коментарии
404 Not Found