MessageFormatter::getLocale
msgfmt_get_locale
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
MessageFormatter::getLocale -- msgfmt_get_locale — Get the locale for which the formatter was created.
Description
Object oriented style
public
string
MessageFormatter::getLocale
( void
)
Procedural style
Get the locale for which the formatter was created.
Parameters
-
formatter
-
The formatter resource
Return Values
The locale name
Examples
Example #1 msgfmt_get_locale() example
<?php
$fmt = msgfmt_create('en_US', "Number {0,number}");
echo msgfmt_get_locale($fmt);
?>
Example #2 OO example
<?php
$fmt = new MessageFormatter('en_US', "Number {0,number}");
echo $fmt->getLocale();
?>
The above example will output:
en_US
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Поддержка языков и кодировок
- Internationalization Functions
- Функция MessageFormatter::create() - Constructs a new Message Formatter
- Функция MessageFormatter::formatMessage() - Quick format message
- Функция MessageFormatter::format() - Format the message
- Функция MessageFormatter::getErrorCode() - Get the error code from last operation
- Функция MessageFormatter::getErrorMessage() - Get the error text from the last operation
- Функция MessageFormatter::getLocale() - Get the locale for which the formatter was created.
- Функция MessageFormatter::getPattern() - Get the pattern used by the formatter
- Функция MessageFormatter::parseMessage() - Quick parse input string
- Функция MessageFormatter::parse() - Parse input string according to pattern
- Функция MessageFormatter::setPattern() - Set the pattern used by the formatter
Коментарии
404 Not Found