Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. <?php
  2. class Palindrome
  3. {
  4. public static function isPalindrome($word)
  5. {
  6.  
  7. $word = lcfirst($word);
  8. $temporary = '';
  9.  
  10. $panjang = strlen($word);
  11. for ($i = $panjang; $i >= 0; --$i) {
  12. @$temporary .= $word[$i];
  13. }
  14. return (strtolower($word) === strtolower(strrev($word)));
  15. }
  16. }
  17.  
  18. echo Palindrome::isPalindrome('Deleveled');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement