PHP setlocale Function

What is setlocale Function?


In PHP this function is used to set locale information.



In the above syntax "constant" specifies the constants used in the function, "location" specifies the country or region for which locale information is required.

The following table displays the constants that can be used
LC_ALL All of the below
LC_COLLATE Sort order
LC_CTYPE Character classification and conversion
LC_MESSAGES System message formatting
LC_MONETARY Monetary/currency formatting
LC_NUMERIC Numeric formatting
LC_TIME Date and time formatting

Example :

echo setlocale(LC_ALL,"En-Us");
echo "<br />";
echo setlocale(LC_ALL,NULL);
Result :

English_United States.1252
English_United States.1252

In the above example both the default and the specified setlocale settings are same.

PHP Topics

Ask Questions

Ask Question