ResourceBundle
PHP Manual

ResourceBundle::getLocales

resourcebundle_locales

(PHP >= 5.3.2)

ResourceBundle::getLocales -- resourcebundle_localesサポートするロケールを取得する

説明

オブジェクト指向型

array ResourceBundle::getLocales ( string $bundlename )

手続き型

array resourcebundle_locales ( string $bundlename )

ResourceBundle 名を指定して、サポートするロケールを取得します。

パラメータ

bundlename

ロケールを取得したい ResourceBundle のパス、あるいは 空文字列を指定するとデフォルトのロケール一覧を取得できます。

返り値

このバンドルがサポートするロケールの一覧を返します。

例1 resourcebundle_locales() の例

<?php
$bundle 
"/user/share/data/myapp";
echo 
join(PHP_EOLresourcebundle_locales($bundle);
?>

上の例の出力は、 たとえば以下のようになります。

es
root

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

<?php
$bundle 
"/usr/share/data/myapp";
$r = new ResourceBundle'es'$bundle);
echo 
join("\n"$r->getLocales($bundle));
?>

上の例の出力は、 たとえば以下のようになります。

es
root

参考


ResourceBundle
PHP Manual