Created
January 19, 2019 10:45
-
-
Save teguhpratama/d7cfb82878cfd5b327ee203ae1ad2ce9 to your computer and use it in GitHub Desktop.
A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward, such as madam or racecar or the number 10801.
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) | |
{ | |
$word = strtolower($word); | |
if ( $word == strrev($word) ) { | |
return true; | |
} | |
return false; | |
} | |
} | |
echo Palindrome::isPalindrome('Hannah'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment