<?php
function isPalindrome($s) {
//s = "A man, a plan, a canal: Panama"
$s= strtolower($s);
$filtered = "";
$len = strlen($s);
for ($i= 0; $i<$len; $i++){
$ascii = ord($s[$i]);
if (($ascii>=97 && $ascii<123) ||
($ascii>47 && $ascii<58)){
$filtered.=$s[$i];
}
}
return $filtered == strrev($filtered);
}
$s = "A man, a plan, a canal: Panama";
echo isPalindrome($s);