Created
September 12, 2017 16:15
-
-
Save mrHiker/380c8c59510730f3926418376c9b5fa2 to your computer and use it in GitHub Desktop.
php: Окончания русских существительных в зависимости от количества
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
| <? | |
| $f = get_field('floors',$id_active); | |
| $f = $f % 100; | |
| if ($f > 19) { | |
| $f = $f % 10; | |
| } | |
| switch ($f) { | |
| case 1: { | |
| echo 'этаж'; | |
| break; | |
| } | |
| case 2: case 3: case 4: { | |
| echo 'этажа'; | |
| break; | |
| } | |
| default: { | |
| echo 'этажей'; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment