×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Dmitriy Lanets
Added: Jul 7, 2015 6:41 AM
Views: 13
Tags: no tags
  1.    function numberEnd($number, $titles) {
  2.         $cases = array (2, 0, 1, 1, 1, 2);
  3.         return $titles[ ($number%100>4 && $number%100<20)? 2 : $cases[min($number%10, 5)] ];
  4.     }