Created
January 18, 2019 06:51
-
-
Save andreaschrist27/5b950cc11f9f179e4fa670dafd4c8443 to your computer and use it in GitHub Desktop.
Palindrome PHP#1
This file contains hidden or 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) | |
{ | |
$wordCase = self::ignoreCase($word); | |
if($wordCase == strrev($wordCase)) | |
{ | |
return true; | |
} | |
return false; | |
} | |
private function ignoreCase($word) | |
{ | |
return strtolower($word); | |
} | |
} | |
echo Palindrome::isPalindrome('deleveled'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment