Created
May 16, 2019 06:55
-
-
Save ahikmatf/54c3971e7d90d3fcce8f13055a54891f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Palindrome | |
{ | |
public static function isPalindrome($word) | |
{ | |
$splittedWord = str_split(strtolower($word)); | |
$reversedSWord = array_reverse($splittedWord); | |
$reversedWord = implode("", $reversedSWord); | |
return strtolower($word) == $reversedWord; | |
} | |
} | |
echo Palindrome::isPalindrome('Deleveled'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment