mamdouh asked this 7 years ago

Check if a string is Palindrome PHP

What is the best way to check if string is Palindrome in PHP?


Best Answer by mamdouh 7 years ago
 function isPal($word)
    {    
        $temp = strtolower(preg_replace("/[^A-Za-z0-9 ]/", '', $word));
        if(strrev($temp)==$temp)
            return TRUE;
        else
            return FALSE;
   }