locale_lookup(3) php man page | unix.com

Man Page: locale_lookup

Operating Environment: php

Section: 3

LOCALE_LOOKUP(3)							 1							  LOCALE_LOOKUP(3)

Locale::lookup - Searches the language tag list for the best match to the language

	Object oriented style

SYNOPSIS
publicstatic string Locale::lookup (array $langtag, string $locale, [bool $canonicalize = false], [string $default])
DESCRIPTION
Procedural 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.
PARAMETERS
o $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 VALUES
The closest matching language tag or default value.
EXAMPLES
Example #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_1996
SEE ALSO
locale_filter_matches(3). PHP Documentation Group LOCALE_LOOKUP(3)
Related Man Pages
locale_get_display_name(3) - php
collator_sort(3) - php
locale_get_display_region(3) - php
locale_get_display_script(3) - php
locale_get_primary_language(3) - php
Similar Topics in the Unix Linux Community
output of an array
How to get only matched contents?
How to inset tabs in ARRAYS
Need to have output of AWK array in one line
Multidimensional array:awk error