You could use a function like this:
function isPalindrome($string) {
$string = strtolower($string);
return (strrev($string) == $string) ? true : false;
}
and then to check a palindrome call an if statement like so:
if(isPalindrome($test)) {
echo $test.' is a palindrome';
}
else {
echo $test.' is not a palindrome';
}
Copyright © 2026 eLLeNow.com All Rights Reserved.