Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

locale_lookup(3) [php man page]

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)

Check Out this Related Man Page

LOCALE_GET_PRIMARY_LANGUAGE(3)						 1					    LOCALE_GET_PRIMARY_LANGUAGE(3)

Locale::getPrimaryLanguage - Gets the primary language for the input locale

	Object oriented style

SYNOPSIS
publicstatic string Locale::getPrimaryLanguage (string $locale) DESCRIPTION
Procedural style string locale_get_primary_language (string $locale) Gets the primary language for the input locale PARAMETERS
o $locale - The locale to extract the primary language code from RETURN VALUES
The language code associated with the language or NULL in case of error. EXAMPLES
Example #1 locale_get_primary_language(3) example <?php echo locale_get_primary_language('zh-Hant'); ?> Example #2 OO example <?php echo Locale::getPrimaryLanguage('zh-Hant'); ?> The above example will output: zh SEE ALSO
locale_get_script(3), locale_get_region(3), locale_get_all_variants(3). PHP Documentation Group LOCALE_GET_PRIMARY_LANGUAGE(3)
Man Page

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

output of an array

Hi gurus, I need to set up an array like this set - A arr 'A', 'B' The output of this array should be like this 'A','B' Right now, I get the output like this 'A B' Can anyone suggest me on how to achieve this. thanks (3 Replies)
Discussion started by: ragha81
3 Replies

2. Shell Programming and Scripting

How to get only matched contents?

Hi, I have an array. @arr=("abcdefgh","ppppppp","rrr"); $tofind="rrr";#string to find. I want to match this string and retrieve only matched contents. In this case rrr is found in 2nd position in an array i want to print only rrr. If the string is matched i have to retrieve only... (1 Reply)
Discussion started by: vanitham
1 Replies

3. Shell Programming and Scripting

Split A String

Hi, I am new to scripting and need help splitting a string using space as the delimiter. How can I do that? I want the result to be stored in an Array. I tried using set -A arr $(echo $FILE) echo $arr The result of the above was ''. Thanks. (2 Replies)
Discussion started by: newbie187
2 Replies

4. Shell Programming and Scripting

Extraction of the output from a string.

Hi Everyone, I stored the result of a certain awk script in the variable arr.The result is /inets /banking /tools. arr= /inets /banking /tools These are 3 direcctories. I should be able to move in to these directories using "cd" command.Can you tell me how to extract... (5 Replies)
Discussion started by: saicharantej
5 Replies

5. Shell Programming and Scripting

How to inset tabs in ARRAYS

Hi I have the follwong command at the end of the program print arr" "arr" "arr} I would like to insert the tabs in these three values and 3 values should be in single line. Would u guys plz :)suggest me what to do! (2 Replies)
Discussion started by: repinementer
2 Replies

6. Shell Programming and Scripting

help - exec time too long

Dear everyone... thanks to this forum I am able to do everyday more and more complex scripts...but now I come up with problem with optimisation.. problem 1 - optimise: here is my code: while read number do nawk -F "|" -v... (8 Replies)
Discussion started by: abdulaziz
8 Replies

7. Programming

Help on some array problem!!

i have no idea how to make a text file abc efg hij klm nop qrs to be a array such as, arr to be "abc efg" arr "hij kml" etc..... in C (2 Replies)
Discussion started by: tyckelvin1
2 Replies

8. Shell Programming and Scripting

Need to have output of AWK array in one line

I have this code echo $logfile | awk ' {arr++; next} END { for (i in arr) {print i} }' that gives me this output result1 result2 result3 I try to figure out how to get it like this result1 result2 result3 (4 Replies)
Discussion started by: Jotne
4 Replies

9. Shell Programming and Scripting

Multidimensional array:awk error

awk -F'\t' -v OFS='\t' ' { if($2 in arr) { #print "Sahi", NR,arr for(k=2;k<=NF;k++){ # sum]+=$2 } } else { arr=NR #print "awk",NR for (k=3;k<=NF ; k++){ sum=$k } } } (7 Replies)
Discussion started by: genome
7 Replies