Created
February 24, 2016 14:06
-
-
Save unglud/0960ea5c955f19ed63d2 to your computer and use it in GitHub Desktop.
Склонение числительных
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
sklonyator($number, $titles){ | |
$cases = array(2, 0, 1, 1, 1, 2); | |
return $titles[($number % 100 > 4 && $number % 100 < 20) ? 2 : $cases[min($number % 10, 5)]]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment