Last active
September 15, 2017 06:04
-
-
Save Pum-purum/9f2ca9bcc365b3e9ee62081866a4289a to your computer and use it in GitHub Desktop.
plural form for russian lexis / множественное число для русских слов
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pluralForm($n, $resultat, $resultata, $resultatov) | |
{ | |
$n = abs($n) % 100; | |
$n1 = $n % 10; | |
if ($n > 10 && $n < 20) return $resultatov; | |
if ($n1 > 1 && $n1 < 5) return $resultata; | |
if ($n1 == 1) return $resultat; | |
return $resultatov; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment