Please wait while we load your page...

PasswordSentry

Latest Version [8.00202205221] Last Updated [May-22-2022]

Tools

PHP Manual [ngettext]

Protect Your Website Today


PHP Manual || Gettext Functions

(PHP 4 >= 4.2.0, PHP 5, PHP 7)

ngettextPlural version of gettext

Description

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

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

Parameters

msgid1

The singular message ID.

msgid2

The plural message ID.

n

The number (e.g. item count) to determine the translation for the respective grammatical number.

Return Values

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

Examples

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

?>



PHP Manual || Gettext Functions