Locale::getAllVariants

(PHP 5 >= 5.3.0, PHP 7, PECL intl >= 1.0.0)
Gets the variants for the input locale
public static array Locale::getAllVariants ( string $locale )

Object oriented style

Procedural style

array locale_get_all_variants ( string $locale )

Gets the variants for the input locale

Parameters:
locale

The locale to extract the variants from

Returns:

The array containing the list of all variants subtag for the locale or NULL if not present

Examples:
locale_get_all_variants() example
<?php
$arr = locale_get_all_variants('sl_IT_NEDIS_ROJAZ_1901');
var_export( $arr );
?>

OO example
<?php
 $arr = Locale::getAllVariants('sl_IT_NEDIS_ROJAZ_1901');
 var_export( $arr );
?>

See also:

locale_get_primary_language() -

locale_get_script() -

locale_get_region() -

doc_php
2016-02-24 15:57:24
Comments
Leave a Comment

Please login to continue.