fork download
  1. <?php
  2.  
  3. function inclineWord($number)
  4. {
  5. $arrWord1 = array(1);
  6. $arrWord2 = array(2,3,4);
  7. $arrWord5 = array(5,6,7,8,9);
  8. foreach ($arrWord1 as $arr1) {
  9. if ($number == $arr1) {
  10. return "рубль";
  11. }
  12. }
  13. foreach ($arrWord2 as $arr2) {
  14. if ($number == $arr2) {
  15. return "рубля";
  16. }
  17. }
  18. foreach ($arrWord5 as $arr5) {
  19. if ($number == $arr5) {
  20. return "рублей";
  21. }
  22. }
  23. }
  24. $result = inclineWord(1);
  25. echo $result;
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
рубль