langfunctionlib.php 257 B

123456789101112
  1. <?php
  2. function get_plural($word)
  3. {
  4. if ($word[strlen($word) - 1] === 's') {
  5. $ret = "{$word}";
  6. } else if ($word[strlen($word) - 1] === 'y') {
  7. $ret = substr($word, 0, strlen($word) - 1) . "ies";
  8. } else {
  9. $ret = "{$word}";
  10. }
  11. return ucfirst($ret);
  12. }