Skip to content

Instantly share code, notes, and snippets.

@teguhpratama
Created January 19, 2019 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teguhpratama/d7cfb82878cfd5b327ee203ae1ad2ce9 to your computer and use it in GitHub Desktop.
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.
<?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