|
MessageFormatter::formatMessagemsgfmt_format_messageQuick format message DescriptionObject-oriented style
public static stringfalse MessageFormatter::formatMessage(string
$locale , string $pattern , array $values )Procedural style stringfalse msgfmt_format_message(string
$locale , string $pattern , array $values )Quick formatting function that formats the string without having to explicitly create the formatter object. Use this function when the format operation is done only once and does not need any parameters or state to be kept or when wanting to customize the output by providing additional context to ICU directly. Parameters
Return Values
The formatted pattern string or ExamplesExample #1 msgfmt_format_message example
Example #2 OO example
The above example will output: 4,560 monkeys on 123 trees make 37.073 monkeys per tree 4.560 Affen auf 123 Bäumen sind 37,073 Affen pro Baum You finished 3rd! There are no apples Example #3 Instructing ICU to format currency with common and with narrow currency symbol Requires ICU ≥ 67.
The above example will output: 123,45 CA$ 123,45 $ See Also
|