« ResourceBundle::getErrorMessage
Spoofchecker »

ResourceBundle::getLocales

resourcebundle_locales

(PHP 5 >= 5.3.2, PHP 7, PHP 8, PECL intl >= 2.0.0)

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

説明

オブジェクト指向型

public static function ResourceBundle::getLocales(string $bundle): array|false

手続き型

function resourcebundle_locales(string $bundle): array|false

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

パラメータ

bundle

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

戻り値

このバンドルがサポートするロケールの一覧を返します。 失敗した場合は false を返します。

例

例1 resourcebundle_locales() の例

<?php
$bundle = "/user/share/data/myapp";
echo join(PHP_EOL, resourcebundle_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   bundle   ロケール   resourcebundle   サポート   locales   getLocales   オブジェクト指向   バンドル   share   myapp   join   root   getErrorMessage   Spoofchecker   intl   static   手続き   user   参考
関連する関数・ページ:
resourcebundle.create   resourcebundle.count   resourcebundle.get   resourcebundle.geterrormessage   resourcebundle.geterrorcode   class.resourcebundle