Created
June 3, 2018 19:56
-
-
Save honno/f9de45c4e62ba3841646c23b05c80ac0 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 | |
function isPalindrome($string) { | |
if (strlen($string) <= 1) { | |
return true; | |
} elseif (strtolower(substr($string, 0, 1)) == strtolower(substr($string, -1))) { | |
isPalindrome(substr($string, 1, -1)); | |
} else { | |
return false; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment