Locale::getRegion

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

Object oriented style

Procedural style

string locale_get_region ( string $locale )

Gets the region for the input locale.

Parameters:
locale

The locale to extract the region code from

Returns:

The region subtag for the locale or NULL if not present

Examples:
locale_get_region() example
1
2
3
<?php
echo locale_get_region('de-CH-1901');
?>
OO example
1
2
3
<?php
echo Locale::getRegion('de-CH-1901');
?>
See also:

locale_get_primary_language() -

locale_get_script() -

locale_get_all_variants() -

doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.