<?php
function inclineWord($number)
{
$arrWord2 = array(2,3,4); $arrWord5 = array(5,6,7,8,9); foreach ($arrWord1 as $arr1) {
if ($number == $arr1) {
return "рубль";
}
}
foreach ($arrWord2 as $arr2) {
if ($number == $arr2) {
return "рубля";
}
}
foreach ($arrWord5 as $arr5) {
if ($number == $arr5) {
return "рублей";
}
}
}
$result = inclineWord(1);
echo $result;
PD9waHAgICAKCmZ1bmN0aW9uIGluY2xpbmVXb3JkKCRudW1iZXIpCnsKICAgICRhcnJXb3JkMSA9IGFycmF5KDEpOwogICAgJGFycldvcmQyID0gYXJyYXkoMiwzLDQpOwogICAgJGFycldvcmQ1ID0gYXJyYXkoNSw2LDcsOCw5KTsKICAgIGZvcmVhY2ggKCRhcnJXb3JkMSBhcyAkYXJyMSkgewogICAgICAgIGlmICgkbnVtYmVyID09ICRhcnIxKSB7CiAgICAgICAgICAgIHJldHVybiAi0YDRg9Cx0LvRjCI7CiAgICAgICAgfQogICAgfQogICAgZm9yZWFjaCAoJGFycldvcmQyIGFzICRhcnIyKSB7CiAgICAgICAgaWYgKCRudW1iZXIgPT0gJGFycjIpIHsKICAgICAgICAgICAgcmV0dXJuICLRgNGD0LHQu9GPIjsKICAgICAgICB9CiAgICB9CiAgICBmb3JlYWNoICgkYXJyV29yZDUgYXMgJGFycjUpIHsKICAgICAgICBpZiAoJG51bWJlciA9PSAkYXJyNSkgewogICAgICAgICAgICByZXR1cm4gItGA0YPQsdC70LXQuSI7CiAgICAgICAgfQogICAgfQp9CiRyZXN1bHQgPSBpbmNsaW5lV29yZCgxKTsKZWNobyAkcmVzdWx0Ow==