Advertisement
yur15t

Склонение числительных

Aug 2nd, 2014
499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  1. function days($dd){
  2.     $dd = 11;
  3.     $d = $dd%10;
  4.     if (($d == 1)&&!($dd == 11)){
  5.         $a = $dd.' день';
  6.     }
  7.     if ((($d==2)||($d==3)||($d==4))&&!(($dd==12)||($dd==13)||($dd==14))){
  8.         $a = $dd.' дня';
  9.     }
  10.     else {
  11.         $a = $dd.' дней';
  12.     }
  13.     return $a;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement