Query: locale_lookup
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
LOCALE_LOOKUP(3) 1 LOCALE_LOOKUP(3) Locale::lookup - Searches the language tag list for the best match to the language Object oriented styleSYNOPSISpublicstatic string Locale::lookup (array $langtag, string $locale, [bool $canonicalize = false], [string $default])DESCRIPTIONProcedural style string locale_lookup (array $langtag, string $locale, [bool $canonicalize = false], [string $default]) Searches the items in $langtag for the best match to the language range specified in $locale according to RFC 4647's lookup algorithm.PARAMETERSo $langtag - An array containing a list of language tags to compare to $locale. Maximum 100 items allowed. o $locale - The locale to use as the language range when matching. o $canonicalize - If true, the arguments will be converted to canonical form before matching. o $default - The locale to use if no match is found.RETURN VALUESThe closest matching language tag or default value.EXAMPLESExample #1 locale_lookup(3) example <?php $arr = array( 'de-DEVA', 'de-DE-1996', 'de', 'de-De' ); echo locale_lookup($arr, 'de-DE-1996-x-prv1-prv2', true, 'en_US'); ?> Example #2 OO example <?php $arr = array( 'de-DEVA', 'de-DE-1996', 'de', 'de-De' ); echo Locale::lookup($arr, 'de-DE-1996-x-prv1-prv2', true, 'en_US'); ?> The above example will output: de_de_1996SEE ALSOlocale_filter_matches(3). PHP Documentation Group LOCALE_LOOKUP(3)
Related Man Pages |
---|
locale(3) - php |
collator_asort(3) - php |
locale_get_display_region(3) - php |
locale_get_keywords(3) - php |
locale_parse(3) - php |
Similar Topics in the Unix Linux Community |
---|
Split A String |
help - exec time too long |
Help on some array problem!! |
Need to have output of AWK array in one line |
Multidimensional array:awk error |