PHPチュートリアル

PHPホーム PHPイントロ PHPインストール PHP構文 PHPコメント PHP変数 PHPエコー/印刷 PHPデータ型 PHP文字列 PHP番号 PHP数学 PHP定数 PHP演算子 PHP If ... Else ... Elseif PHPスイッチ PHPループ PHP関数 PHP配列 PHPスーパーグローバル PHP正規表現

PHPフォーム

PHPフォーム処理 PHPフォームの検証 PHPフォームが必要 PHPフォームのURL / Eメール PHPフォームの完了

PHP Advanced

PHPの日付と時刻 PHPインクルード PHPファイルの処理 PHPファイルのオープン/読み取り PHPファイルの作成/書き込み PHPファイルのアップロード PHPクッキー PHPセッション PHPフィルター PHPフィルターアドバンスト PHPコールバック関数 PHP JSON PHPの例外

PHPOOP _

PHPOOPとは PHPクラス/オブジェクト PHPコンストラクター PHPデストラクタ PHPアクセス修飾子 PHPの継承 PHP定数 PHP抽象クラス PHPインターフェース PHPの特性 PHP静的メソッド PHPの静的プロパティ PHP名前空間 PHPIterables

MySQLデータベース

MySQLデータベース MySQLコネクト MySQL Create DB MySQLテーブルの作成 MySQLの挿入データ MySQLは最後のIDを取得します MySQL Insert Multiple MySQLを準備しました MySQL Select Data MySQL Where MySQL Order By MySQLデータの削除 MySQLアップデートデータ MySQL制限データ

PHP XML

PHPXMLパーサー PHPSimpleXMLパーサー PHPSimpleXML-取得 PHP XMLExpat PHP XML DOM

PHP -AJAX

AJAXイントロ AJAX PHP AJAXデータベース AJAX XML AJAXライブ検索 AJAXポール

PHPの

PHPの例 PHPコンパイラ PHPクイズ PHP演習 PHP証明書

PHPリファレンス

PHPの概要 PHP配列 PHPカレンダー PHPの日付 PHPディレクトリ PHPエラー PHP例外 PHPファイルシステム PHPフィルター PHP FTP PHP JSON PHPキーワード PHP Libxml PHPメール PHP数学 PHPその他 PHP MySQLi PHPネットワーク PHP出力制御 PHP正規表現 PHP SimpleXML PHPストリーム PHP文字列
addcslashes() addlashes() bin2hex() チョップ() chr() チャンクスプリット() convert_cyr_string() convert_uudecode() convert_uuencode() count_chars() crc32() crypt() エコー() explode() fprint() get_html_translation_table() hebrev() hebrevc() hex2bin() html_entity_decode() htmlentities() htmlspecialchars_decode() htmlspecialchars() implode() 加入() lcfirst() レーベンシュタイン() localeconv() ltrim() md5() md5_file() metaphone() money_format() nl_langinfo() nl2br() number_format() words() parse_str() print() printf() quoted_printable_decode() quoted_printable_encode() quotemeta() rtrim() setlocale() sha1() sha1_file() 類似のテキスト() soundex() sprintf() sscanf() str_getcsv() str_ireplace() str_pad() str_repeat() str_replace() str_rot13() str_shuffle() str_split() str_word_count() strcasecmp() strchr() strcmp() strcoll() strcspn() strip_tags() stripcslashes() stripslashes() 漫画 () ストリップ() strlen() strnatcasecmp() strnatcmp() strncasecmp() strncmp() strpbrk() strpos() strrchr() strrev() strripos() strrpos() strspn() strstr() strtok() strtolower() strtoupper() strtr() substr() substr_compare() substr_count() substr_replace() トリム() ucfirst() ucwords() vfprintf() vprintf() vsprintf() ワードラップ()
PHP変数の処理 PHPXMLパーサー PHP Zip PHPタイムゾーン

PHP setlocale()関数

❮PHP文字列リファレンス

ロケールを米国英語に設定してから、再びデフォルトに戻します。

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

定義と使用法

setlocale()関数は、ロケール情報を設定します。

ロケール情報は、地理的領域に固有の言語、金銭、時間、およびその他の情報です。

注: setlocale()関数は、現在のスクリプトのロケールのみを変更します。

ヒント:ロケール情報は、setlocale(LC_ALL、NULL)を使用してシステムのデフォルトに設定できます。

ヒント:数値フォーマット情報を取得するには、 localeconv()関数を参照してください。


構文

setlocale(constant,location)

パラメータ値

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.

技術的な詳細

戻り値: 現在のロケール設定を返します。失敗した場合はFALSEを返します。戻り値は、PHPが実行されているシステムによって異なります。
PHPバージョン: 4歳以上
変更ログ: PHP 5.3.0-LC_定数の代わりに文字列が定数パラメーターに渡された場合、この関数はE_DREPRECATED通知をスローします。

❮PHP文字列リファレンス