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