Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Palindrome
- {
- public static function isPalindrome($word)
- {
- $word = lcfirst($word);
- $temporary = '';
- $panjang = strlen($word);
- for ($i = $panjang; $i >= 0; --$i) {
- @$temporary .= $word[$i];
- }
- return (strtolower($word) === strtolower(strrev($word)));
- }
- }
- echo Palindrome::isPalindrome('Deleveled');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement