mamdouh asked this 2 years ago

Check if a string is Palindrome PHP

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


mamdouh 2 years ago
1 like

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