$pal = true;
for ($i = 0; $i < strlen($word)/2; ++$i, --$j) {
// skip spaces
while ($word[$i] === " ") {$i++;}
while ($word[$j] === " ") {$j--;}
echo "$word[$i]== $word[$j]\n";
if ($word[$i] !== $word[$j]) {
$pal = false;
break;
}
}
if ($pal) print "yes"; else print "no";
JGogPSBzdHJsZW4gKCR3b3JkKS0xOwokcGFsID0gdHJ1ZTsKCmZvciAoJGkgPSAwOyAkaSA8IHN0cmxlbigkd29yZCkvMjsgKyskaSwgLS0kaikgewoKICAgIC8vIHNraXAgc3BhY2VzCiAgICB3aGlsZSAoJHdvcmRbJGldID09PSAiICIpIHskaSsrO30KICAgIHdoaWxlICgkd29yZFskal0gPT09ICIgIikgeyRqLS07fQoKICAgIGVjaG8gIiR3b3JkWyRpXT09ICR3b3JkWyRqXVxuIjsKICAgIGlmICgkd29yZFskaV0gIT09ICR3b3JkWyRqXSkgICAgewogICAgICAgICRwYWwgPSBmYWxzZTsKICAgICAgICBicmVhazsKICAgICAgICB9Cn0KCmlmICgkcGFsKSBwcmludCAieWVzIjsgZWxzZSBwcmludCAibm8iOw==