Guest User

Untitled

a guest
Jan 18th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. <?php
  2. class Palindrome
  3. {
  4. public static function isPalindrome($word)
  5. {
  6. $wordCase = self::ignoreCase($word);
  7.  
  8. if($wordCase == strrev($wordCase))
  9. {
  10. return true;
  11. }
  12.  
  13. return false;
  14. }
  15.  
  16. private function ignoreCase($word)
  17. {
  18. return strtolower($word);
  19. }
  20. }
  21.  
  22. echo Palindrome::isPalindrome('deleveled');
Add Comment
Please, Sign In to add comment