首页 >函数列表 >ngettext

ngettext

ngettext

(PHP 4 >= 4.2.0, PHP 5)

ngettextPlural version of gettext

说明

string ngettext ( string $msgid1 , string $msgid2 , int $n )

The plural version of gettext(). Some languages have more than one form for plural messages dependent on the count.

参数

msgid1

msgid2

n

返回值

Returns correct plural form of message identified by msgid1 and msgid2 for count n.

范例

Example #1 ngettext() example

<?php

setlocale
(LC_ALL'cs_CZ');
printf(ngettext("%d window""%d windows"1), 1); // 1 okno
printf(ngettext("%d window""%d windows"2), 2); // 2 okna
printf(ngettext("%d window""%d windows"5), 5); // 5 oken

?>


  • bindtextdomain
  • bind_textdomain_codeset
  • dcgettext
  • dcngettext
  • dgettext
  • dngettext
  • gettext
  • ngettext
  • textdomain
  • PHP MySQL HTML CSS JavaScript MSSQL AJAX .NET JSP Linux Mac ASP 服务器 SQL jQuery C# C++ java Android IOS oracle MongoDB SQLite wamp 交通频道