Current Location: Home> Function Categories> setlocale

setlocale

Setting the locale information
Name:setlocale
Category:String
Programming Language:php
One-line Description:Set up regional information (regional information).

Definition and usage

setlocale() function sets the region information (region information).

Regional information is the language, currency, time and other information for a geographical area.

Note: setlocale() function changes region information only for the current script.

Tip: You can set the region information to the system default through setlocale(LC_ALL,NULL) .

Tip: If you want to obtain numeric format information, please refer to localeconv() function.

Example

Set the region to US English, and then reset it back to the system default:

 <?php
echo setlocale ( LC_ALL , "US" ) ;
echo "<br>" ;
echo setlocale ( LC_ALL , NULL ) ;
?>

Try it yourself

Similar Functions