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

search for in the

ResourceBundle::getLocales> <ResourceBundle::getErrorMessage
[edit] Last updated: Fri, 25 May 2012

view this page in

ResourceBundle::get

resourcebundle_get

(PHP >= 5.3.2, PECL intl >= 2.0.0)

ResourceBundle::get -- resourcebundle_getバンドルからデータを取得する

説明

オブジェクト指向型

mixed ResourceBundle::get ( string|int $index )

手続き型

mixed resourcebundle_get ( ResourceBundle $r , string|int $index )

インデックスあるいは文字列キーを指定して、バンドルからデータを取得します。

パラメータ

r

ResourceBundle オブジェクト。

index

データのインデックス。文字列あるいは整数値となります。

返り値

指定したインデックスのデータ、あるいはエラー時に NULL を返します。 文字列、整数値、バイナリデータ文字列は、それぞれに対応する PHP の型として返します。 整数の配列は PHP の配列として返します。複雑な型は ResourceBundle オブジェクトとして返します。

例1 resourcebundle_get() の例

<?php
$r 
resourcebundle_create'es'"/usr/share/data/myapp");
echo 
resourcebundle_get($r'somestring');
?>

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

<?php
$r 
= new ResourceBundle'es'"/usr/share/data/myapp");
echo 
$r->get('somestring');
?>

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

?Hola, mundo!

参考



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

 
show source | credits | stats | sitemap | contact | advertising | mirror sites