Guest User

Untitled

a guest
Jan 19th, 2019
72
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. public static function isPalindrome($word)
  5. {
  6. $word = strtolower($word); // change to lowercase
  7. $reverse_word = strrev($word); // reverse word
  8.  
  9. if ($word == $reverse_word) { // compare
  10. return true;
  11. } else {
  12. return false;
  13. }
  14. }
  15. }
  16.  
  17. echo Palindrome::isPalindrome('Deleveled');
Add Comment
Please, Sign In to add comment