ResourceBundle::create

(PHP >= 5.3.2, PECL intl >= 2.0.0)
Create a resource bundle
public static ResourceBundle ResourceBundle::create ( string $locale, string $bundlename [, bool $fallback ] )

Object oriented style (method)

Procedural style

ResourceBundle resourcebundle_create ( string $locale , string $bundlename [, bool $fallback ] )

Object oriented style (constructor):

public ResourceBundle::__construct ( string $locale , string $bundlename [, bool $fallback ] )

Creates a resource bundle.

Parameters:
locale

Locale for which the resources should be loaded (locale name, e.g. en_CA).

bundlename

The directory where the data is stored or the name of the .dat file.

fallback

Whether locale should match exactly or fallback to parent locale is allowed.

Returns:

Returns ResourceBundle object or NULL on error.

Examples:
resourcebundle_create() example
<?php
$r = resourcebundle_create( 'es', "/usr/share/data/myapp");
echo $r['teststring'];
?>

ResourceBundle::create() example
<?php
$r = ResourceBundle::create( 'es', "/usr/share/data/myapp");
echo $r['teststring'];
?>

See also:

resourcebundle_get() -

doc_php
2016-02-24 15:57:51
Comments
Leave a Comment

Please login to continue.