locale_parse(3) php man page | unix.com

Man Page: locale_parse

Operating Environment: php

Section: 3

LOCALE_PARSE(3) 							 1							   LOCALE_PARSE(3)

Locale::parseLocale - Returns a key-value array of locale ID subtag elements.

	Object oriented style

SYNOPSIS
publicstatic array Locale::parseLocale (string $locale)
DESCRIPTION
Procedural style array locale_parse (string $locale) Returns a key-value array of locale ID subtag elements.
PARAMETERS
o $locale - The locale to extract the subtag array from. Note: The 'variant' and 'private' subtags can take maximum 15 values whereas 'ext- lang' can take maximum 3 values.
RETURN VALUES
Returns an array containing a list of key-value pairs, where the keys identify the particular locale ID subtags, and the values are the associated subtag values. The array will be ordered as the locale id subtags e.g. in the locale id if variants are '-varX-varY-varZ' then the returned array will have variant0=>varX , variant1=>varY , variant2=>varZ
EXAMPLES
Example #1 locale_parse(3) example <?php $arr = locale_parse('sl-Latn-IT-nedis'); if ($arr) { foreach ($arr as $key => $value) { echo "$key : $value , "; } } ?> Example #2 OO example <?php $arr = Locale::parseLocale('sl-Latn-IT-nedis'); if ($arr) { foreach ($arr as $key => $value) { echo "$key : $value , "; } } ?> The above example will output: language : sl , script : Latn , region : IT , variant0 : NEDIS ,
SEE ALSO
locale_compose(3). PHP Documentation Group LOCALE_PARSE(3)
Related Man Pages
locale(3) - php
collator_sort_with_sort_keys(3) - php
datefmt_localtime(3) - php
locale_get_display_script(3) - php
locale_lookup(3) - php
Similar Topics in the Unix Linux Community
store key value
Extraction of the output from a string.
awk script to split field data
help - exec time too long
Need a Bash script for iterating thru an array and running a command