Complete PHP String Reference
The setlocale() function sets locale information.
Locale information is language, monetary, time and other information specific for a geographical area.
This function returns the current locale settings, or FALSE on failure.
| Parameter | Description |
|---|---|
| constant | Required. Specifies what locale information should be set. Available constants:
|
| location | Required. Specifies what country/region to set the locale
information to. Can be a string or an array. If the location is an array, setlocale() will try each array element until it finds a valid language or
region code. This is very useful if a region is known under different names
on different systems. Note: To view all available language codes, go to our Language code reference. |
Note: The setlocale() function changes the locale only for the current script.
Tip: The locale information can be set to system default with setlocale(LC_ALL,NULL)
In this example we will set the locale to US English and then back to default again:
The output of the code above will be:
Complete PHP String Reference
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|