Query: locale_parse
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
LOCALE_PARSE(3) 1 LOCALE_PARSE(3) Locale::parseLocale - Returns a key-value array of locale ID subtag elements. Object oriented styleSYNOPSISpublicstatic array Locale::parseLocale (string $locale)DESCRIPTIONProcedural style array locale_parse (string $locale) Returns a key-value array of locale ID subtag elements.PARAMETERSo $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 VALUESReturns 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=>varZEXAMPLESExample #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 ALSOlocale_compose(3). PHP Documentation Group LOCALE_PARSE(3)
Related Man Pages |
---|
locale(3) - php |
collator_asort(3) - php |
locale_get_display_region(3) - php |
locale_get_display_script(3) - php |
locale_lookup(3) - php |
Similar Topics in the Unix Linux Community |
---|
accessing my first element of array |
awk problems |
Extraction of the output from a string. |
bash Script: Issue with iterating Directory and store into array |
Grep command construction |