Skip to content

Instantly share code, notes, and snippets.

@atyahyde
Created January 20, 2019 05:54
Show Gist options
  • Save atyahyde/72c3f3b72862972e0602911886dd8741 to your computer and use it in GitHub Desktop.
Save atyahyde/72c3f3b72862972e0602911886dd8741 to your computer and use it in GitHub Desktop.
<?php
class Palindrome
{
public static function isPalindrome($word)
{
$temp = strtolower(preg_replace("/[^A-Za-z0-9 ]/", '', $word));
if(strrev($temp)==$temp)
return TRUE;
else
return FALSE;
}
}
echo Palindrome::isPalindrome('Deleveled');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment