Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Palindrome
- {
- public static function isPalindrome($word){
- $reverse = '';
- $length = strlen($word);
- $tempLow= strtolower($word);
- for($i=$length-1;$i>=0;$i--){
- $reverse .= $tempLow[$i];
- }
- if($tempLow==$reverse) return true;
- else return false;
- }
- }
- echo Palindrome::isPalindrome('Deleveled');
Add Comment
Please, Sign In to add comment