function isPalindrome(string $s): bool {
// Remove non-alphanumeric characters and convert to lowercase
$normalized = strtolower(preg_replace("/[^a-zA-Z0-9]/", "", $s));
echo $normalized . PHP_EOL;
return $normalized === strrev($normalized);
}
$s = "+^-Ab#c!D 50...# 05*()dcB[]A##@!$";
echo isPalindrome($s) ? 'true' : 'false';
/*
run:
abcd5005dcba
true
*/