plural — Transform arguments in an array suitable for __.

Locale-related functions

Summary

plural($msgid, $msgid_plural, $n)

Transform arguments in an array suitable for __.

<code> $n = count($items); echo __(plural(‘one item’, ‘%s items’, $n), $n); </code>

Parameters:
  • $msgid (string) – The string to be translated, singular form

  • $msgid_plural (string) – The string to be translated, plural form

  • $n (int) – Used to determine the plural form

Returns:

array Array to pass to __

Usage

Examples

See Also