The setlocale() method is used to set locale information.
Syntax
setlocale(constant, loc)
Parameters
constant − It specifies the locale information that should be set.
The following are the available constants −
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
loc − It contains the information of country or region. If the location is "0", then the location setting is not affected and only the current setting is returned.
Return
The setlocale() function returns the current locale settings. It returns FALSE on failure.
Example
The following is an example −
<?php echo setlocale(LC_ALL,NULL); ?>
Output
en_US.UTF-8