- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
setlocale() function in PHP
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
Advertisements