MessageFormatter::getLocale

(PHP 5 >= 5.3.0, PHP 7, PECL intl >= 1.0.0)
Get the locale for which the formatter was created.
public string MessageFormatter::getLocale ( void )

Object oriented style

Procedural style

string msgfmt_get_locale ( NumberFormatter $formatter )

Get the locale for which the formatter was created.

Parameters:
formatter

The formatter resource

Returns:

The locale name

Examples:
msgfmt_get_locale() example
<?php
$fmt = msgfmt_create('en_US', "Number {0,number}");
echo msgfmt_get_locale($fmt);
?>

OO example
<?php
$fmt = new MessageFormatter('en_US', "Number {0,number}");
echo $fmt->getLocale();
?>

See also:

msgfmt_create() -

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

Please login to continue.