(PHP 5 >= 5.3.0, PHP 7, PECL intl >= 1.0.0)
Locale::getDisplayRegion -- locale_get_display_region — Retourne un nom pour la région de la locale
Style orienté objet
$locale
[, string $in_locale
] ) : stringStyle procédural
$locale
[, string $in_locale
] ) : string
Retourne un nom pour la région de la locale. Si NULL est passé,
la locale par défaut est utilisée.
localeLa locale dont il faut extraire le nom de la région.
in_localeUn formation optionnel pour afficher le nom de la région.
Le nom de la région de la locale $locale, au format $in_locale.
Exemple #1 Exemple avec locale_get_display_region(), procédural
<?php
echo locale_get_display_region('sl-Latn-IT-nedis', 'en');
echo ";\n";
echo locale_get_display_region('sl-Latn-IT-nedis', 'fr');
echo ";\n";
echo locale_get_display_region('sl-Latn-IT-nedis', 'de');
?>
Exemple #2 Exemple avec locale_get_display_region(), POO
<?php
echo Locale::getDisplayRegion('sl-Latn-IT-nedis', 'en');
echo ";\n";
echo Locale::getDisplayRegion('sl-Latn-IT-nedis', 'fr');
echo ";\n";
echo Locale::getDisplayRegion('sl-Latn-IT-nedis', 'de');
?>
L'exemple ci-dessus va afficher :
Italy; Italie; Italien