ff

PHP ICU exaples

Pluralization

<?php print msgfmt_format_message( 'ru', " {goods, number} { goods, plural, one{товар} few{товара} many{товаров} other{товара} }", ['goods' => 251] ); $formatter = MessageFormatter::create('ru', '{goods, plural, one{товар} few{товара} many{товаров} other{товаров}}'); print $formatter->format(['goods' => 251]);

Formatting number

<?php msgfmt_format_message( 'ru', "{goods, number}", ['goods' => 100500] )