downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Locale::getDisplayName> <Locale::getDefault
[edit] Last updated: Fri, 24 May 2013

view this page in

Locale::getDisplayLanguage

locale_get_display_language

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

Locale::getDisplayLanguage -- locale_get_display_languageRetourne un nom approprié pour l'affichage d'un nom de langue

Description

Style orienté objet

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

Style procédural

string locale_get_display_language ( string $locale [, string $in_locale ] )

Retourne un nom approprié pour l'affichage d'un nom de langue. Si la valeur NULL est passée en argument, la locale par défaut est utilisée.

Liste de paramètres

locale

La locale dont il faut retourner le nom de langue

in_locale

Un format optionnel pour l'affichage du nom de langue.

Valeurs de retour

Le nom de la langue à afficher pour la locale $locale, dans le format défini par $in_locale.

Exemples

Exemple #1 Exemple avec locale_get_display_language(), procédural

<?php
echo locale_get_display_language('sl-Latn-IT-nedis''en');
echo 
";\n";
echo 
locale_get_display_language('sl-Latn-IT-nedis''fr');
echo 
";\n";
echo 
locale_get_display_language('sl-Latn-IT-nedis''de');
?>

Exemple #2 Exemple avec locale_get_display_language(), POO

<?php
echo Locale::getDisplayLanguage('sl-Latn-IT-nedis''en');
echo 
";\n";
echo 
Locale::getDisplayLanguage('sl-Latn-IT-nedis''fr');
echo 
";\n";
echo 
Locale::getDisplayLanguage('sl-Latn-IT-nedis''de');
?>

L'exemple ci-dessus va afficher :

Slovenian;
slov\xc3\xa8ne;
Slowenisch

Voir aussi



add a note add a note User Contributed Notes Locale::getDisplayLanguage - [1 notes]
up
0
heitor dot siller at gmail dot com
1 year ago
To display special characters correctly in a web browser, it's a good idea to decode the result data with utf8_decode:

<?php

echo utf8_decode(Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'fr'));

echo
utf8_decode(Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'pt-BR'));

?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites