downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Normalizer> <Locale::parseLocale
Last updated: Fri, 13 Nov 2009

view this page in

Locale::setDefault

locale_set_default

(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)

Locale::setDefault -- locale_set_defaultデフォルトの実行時ロケールを設定する

説明

オブジェクト指向型

static bool Locale::setDefault ( string $locale )

手続き型

bool locale_set_default ( string $locale )

デフォルトの実行時ロケールを $locale に設定します。 これは INTL のグローバル 'default_locale' のロケール ID となります。UAX #35 拡張も使用可能です。

パラメータ

locale

BCP 47 準拠の言語タグ。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

例1 locale_set_default() の例

<?php
locale_set_default
('de-DE');
echo 
locale_get_default();
?>

例2 オブジェクト指向の例

<?php
Locale
::setDefault('de-DE');
echo 
Locale::getDefault();
?>

上の例の出力は以下となります。

de-DE

参考

  • locale_get_default() - INTL のグローバル 'default_locale' からデフォルトのロケールを取得する



add a note add a note User Contributed Notes
Locale::setDefault
There are no user contributed notes for this page.

Normalizer> <Locale::parseLocale
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites