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