nl_langinfo

(PHP 4 >= 4.1.0, PHP 5)

nl_langinfo --  Rassemble des informations sur la langue et la configuration locale.

Description

string nl_langinfo ( int item)

nl_langinfo() est utilisée pour accéder à chaque élément de la configuration locale. Contrairement à la fonction localeconv() qui renvoie tous les éléments, nl_langinfo() vous permet de sélectionner un élément précis.

Si le paramètre item n'est pas valide, FALSE sera retourné.

item peut être la valeur entière d'un élément, ou le nom de sa contante. Voici une liste des noms de constantes pour item qui peuvent être utilisés et leurs descriptions. Certaines constantes peuvent ne pas être définies, ou ne contenir aucune valeur pour certaines locales.

Tableau 1. Constantes nl_langinfo()

ConstanteDescription
Constantes de la catégorie LC_TIME
ABDAY_(1-7)Nom abbrévié du n-ème jour de la semaine.
DAY_(1-7)Nom du n-ème jour de la semaine (DAY_1 = Dimanche).
ABMON_(1-12)Nom abbrévié du n-ème mois de l'année.
MON_(1-12)Nom du n-ème mois de l'année.
AM_STRChaîne pour Ante meridian.
PM_STRChaîne pour Post meridian.
D_T_FMT Chaîne pouvant être utilisée comme chaîne de formatage pour la fonction strftime() pour représenter la date et l'heure.
D_FMT Chaîne pouvant être utilisée comme chaîne de formatage pour la fonction strftime() pour représenter la date.
T_FMT Chaîne pouvant être utilisée comme chaîne de formatage pour la fonction strftime() pour représenter l'heure.
T_FMT_AMPM Chaîne pouvant être utilisée comme chaîne de formatage pour la fonction strftime() pour représenter l'heure au format 12-heure avec ante/post meridian.
ERAAlternate era.
ERA_YEARYear in alternate era format.
ERA_D_T_FMTDate and time in alternate era format (string can be used in strftime()).
ERA_D_FMTDate in alternate era format (string can be used in strftime()).
ERA_T_FMTTime in alternate era format (string can be used in strftime()).
Constantes de la catégorie LC_MONETARY
INT_CURR_SYMBOLInternational currency symbol.
CURRENCY_SYMBOLLocal currency symbol.
CRNCYSTRSame value as CURRENCY_SYMBOL.
MON_DECIMAL_POINTDecimal point character.
MON_THOUSANDS_SEPThousands separator (groups of three digits).
MON_GROUPINGLike 'grouping' element.
POSITIVE_SIGNSign for positive values.
NEGATIVE_SIGNSign for negative values.
INT_FRAC_DIGITSInternational fractional digits.
FRAC_DIGITSLocal fractional digits.
P_CS_PRECEDESReturns 1 if CURRENCY_SYMBOL precedes a positive value.
P_SEP_BY_SPACEReturns 1 if a space separates CURRENCY_SYMBOL from a positive value.
N_CS_PRECEDESReturns 1 if CURRENCY_SYMBOL precedes a negative value.
N_SEP_BY_SPACEReturns 1 if a space separates CURRENCY_SYMBOL from a negative value.
P_SIGN_POSN

  • Returns 0 if parentheses surround the quantity and currency_symbol.

  • Returns 1 if the sign string precedes the quantity and currency_symbol.

  • Returns 2 if the sign string follows the quantity and currency_symbol.

  • Returns 3 if the sign string immediately precedes the currency_symbol.

  • Returns 4 if the sign string immediately follows the currency_symbol.

N_SIGN_POSN
Constantes de la catégorie LC_NUMERIC
DECIMAL_POINTDecimal point character.
RADIXCHARSame value as DECIMAL_POINT.
THOUSANDS_SEPSeparator character for thousands (groups of three digits).
THOUSEPSame value as THOUSANDS_SEP.
GROUPING 
Constantes de la catégorie LC_MESSAGES
YESEXPRRegex string for matching 'yes' input.
NOEXPRRegex string for matching 'no' input.
YESSTROutput string for 'yes'.
NOSTROutput string for 'no'.
Constantes de la catégorie LC_CTYPE
CODESETReturn a string with the name of the character encoding.

Note : Cette fonction n'est pas implémentée sous Windows.

Voir aussi setlocale() et localeconv().