PHP Function LocaleConv
php function localeconv is an inbuilt and important function of php programming language which gets the numeric formatting information of a particular region. It is very useful for developing multilingual applications and web sites. The function works based on the system’s regional/language settings set by the system administrator via control panel of Windows or by using the gettext() function (which reads data from.mo files).
The localeconv() function returns an associative array that contains local numeric and monetary formatting information. The p_sign_posn and n_sign_posn fields are used to identify the number sign and digit position respectively in a number string. The grouping and mon_grouping fields indicate how numbers should be grouped and separated.
Other fields are used to describe how a decimal point should be displayed and whether or not a currency symbol should be placed before the value or after it. The frac_digits field represents international fractional digits.
To avoid the unexpected behavior of localeconv() in a multi-threaded environment, use the ltrim function (which removes whitespaces from a string). The strftime and gmstrftime functions format a Unix timestamp based on the current locale set by the LC_CONSTANTS constants or the LANGUAGE setting in the PHP configuration file. These functions may not be suitable for all locales, especially in multi-threaded environments.
Altova XMLSpy, the world’s best-selling XML editor, is designed to meet your XML and XSD needs from start to finish. Get your free 30-day trial today! For more information, visit the XMLSpy website.