Skip to content

Instantly share code, notes, and snippets.

@tot-ra
Created March 18, 2013 23:53
Show Gist options
  • Save tot-ra/5192168 to your computer and use it in GitHub Desktop.
Save tot-ra/5192168 to your computer and use it in GitHub Desktop.
Conversion of number to one of the countable forms in russian
function num2MultipleRus($int){
$str=strval($int);
$fin=$str[strlen($str)-1];
if ($fin==1) return 1;
elseif ($fin>1 && $fin<5) return 2;
elseif ($fin>4) return 3;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment