Advertisement
Guest User

Untitled

a guest
May 25th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. <?php
  2. class Palindrome
  3. {
  4.  
  5. public static function isPalindrome($word)
  6. {
  7. if (strtolower(strrev($word)) == strtolower($word)){
  8. echo $word." is a palindrome.\n\n";
  9. return true;
  10. }
  11. else{
  12. echo $word." is not a palindrome.\n\n";
  13. return false;
  14. }
  15. }
  16. }
  17. echo Palindrome::isPalindrome('Deleveled');
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement