Locale::getDisplayRegion

locale_get_display_region

(PHP 5 >= 5.3.0, PHP 7, PECL intl >= 1.0.0)

Locale::getDisplayRegion -- locale_get_display_regionRetourne un nom pour la région de la locale

Description

Style orienté objet

public static Locale::getDisplayRegion ( string $locale [, string $in_locale ] ) : string

Style procédural

locale_get_display_region ( string $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.

Liste de paramètres

locale

La locale dont il faut extraire le nom de la région.

in_locale

Un formation optionnel pour afficher le nom de la région.

Valeurs de retour

Le nom de la région de la locale $locale, au format $in_locale.

Exemples

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

Voir aussi