Javatpoint Logo
Javatpoint Logo

PHP string setlocale() Function

The string setlocale() function is in-built function of PHP. It is used to set local information. It returns the new current locale and False if the locale functionality is not implemented.

Note: It returns value depends on the system.


Parameter Description Required/Optional
constant Specify the local information to be set. Following constant:
  • LC_ALL: For all of the below
  • LC_COLLATE: Sort order
  • LC_CTYPE: Character classification and conversion (e.g. all characters should be lower or upper-case)
  • LC_MESSAGES: System message formatting
  • LC_MONETARY: Monetary/currency formatting
  • LC_NUMERIC: Numeric formatting
  • LC_TIME: Date and time formatting
Location Specify what country/region to set the local information. Required

Example 1


Your Location is:US
By using setlocale() function:English_United States.1252

Example 2


Your Location is: NULL
By using setlocale() function:English_United States.1252

Next TopicPHP String

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA