PHP handleiding

PHP TUIS PHP Inleiding PHP installeer PHP sintaksis PHP opmerkings PHP veranderlikes PHP Echo / Druk PHP datatipes PHP Strings PHP-nommers PHP Wiskunde PHP konstante PHP-operateurs PHP As...Anders...Elseif PHP skakelaar PHP-lusse PHP funksies PHP-skikkings PHP Superglobals PHP RegEx

PHP- vorms

PHP-vormhantering PHP-vorm validering PHP-vorm word vereis PHP-vorm URL/e-pos PHP-vorm voltooi

PHP Gevorderd

PHP datum en tyd PHP sluit in PHP-lêerhantering PHP-lêer oop/lees PHP-lêer skep/skryf PHP-lêer oplaai PHP-koekies PHP-sessies PHP filters PHP-filters Gevorderd PHP-terugbelfunksies PHP JSON PHP-uitsonderings

PHP OOP

PHP Wat is OOP PHP Klasse/Objekte PHP Konstrukteur PHP vernietiger PHP Toegangswysigers PHP erfenis PHP konstante PHP Abstrakte Klasse PHP-koppelvlakke PHP eienskappe PHP statiese metodes PHP Statiese Eienskappe PHP naamruimtes PHP Iterables

MySQL- databasis

MySQL-databasis MySQL Connect MySQL Skep DB MySQL Skep tabel MySQL Voeg data in MySQL Kry Laaste ID MySQL Voeg veelvuldige in MySQL voorberei MySQL Kies Data MySQL Waar MySQL Bestel deur MySQL verwyder data MySQL-opdateringsdata MySQL-limietdata

PHP XML

PHP XML-ontleders PHP SimpleXML-ontleder PHP SimpleXML - Kry PHP XML Expat PHP XML DOM

PHP - AJAX

AJAX Intro AJAX PHP AJAX-databasis AJAX XML AJAX Live Search AJAX-peiling

PHP voorbeelde

PHP voorbeelde PHP samesteller PHP vasvra PHP Oefeninge PHP-sertifikaat

PHP- verwysing

PHP Oorsig PHP Skikking PHP-kalender PHP datum PHP gids PHP fout PHP-uitsondering PHP lêerstelsel PHP filter PHP FTP PHP JSON PHP sleutelwoorde PHP Libxml PHP-pos PHP Wiskunde PHP Diverse PHP MySQLi PHP-netwerk PHP-uitsetbeheer PHP RegEx PHP SimpleXML PHP-stroom PHP-string PHP veranderlike hantering PHP XML-ontleder PHP zip PHP Tydsones

PHP setlocale() Funksie

❮ PHP-stringverwysing

Voorbeeld

Stel die plek in op Amerikaanse Engels en dan weer terug na verstek:

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

Definisie en gebruik

Die setlocale() funksie stel locale inligting.

Plaaslike inligting is taal-, geld-, tyd- en ander inligting spesifiek vir 'n geografiese gebied.

Let wel: Die setlocale() funksie verander die locale slegs vir die huidige script.

Wenk: Die locale inligting kan gestel word op stelsel verstek met setlocale(LC_ALL,NULL)

Wenk: Sien die localeconv()- funksie om inligting oor numeriese formatering te kry .


Sintaksis

setlocale(constant,location)

Parameterwaardes

Parameter Description
constant Required. Specifies what locale information should be set.

Available constants:

  • LC_ALL - 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 Required. Specifies what country/region to set the locale information to. Can be a string or an array. It is possible to pass multiple locations.

If the location is NULL or the empty string "", the location names will be set from the values of environment variables with the same names as the constants above, or from "LANG".

If the location is "0", the location setting is not affected, only the current setting is returned.

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.

Tegniese besonderhede

Terugkeerwaarde: Wys die huidige ligginginstellings, of ONWAAR as dit misluk. Die terugkeerwaarde hang af van die stelsel wat PHP gebruik.
PHP weergawe: 4+
Veranderinglog: PHP 5.3.0 - As 'n string na die konstante parameter gestuur word in plaas van een van die LC_ konstantes, gooi hierdie funksie 'n E_DREPRECATED kennisgewing.

❮ PHP-stringverwysing