<?php
$text = "пр н ппнанпп н рп";
$resultTrue = 'палиндром';
$resultFalse = 'не палиндром';
$halgLength = floor($length / 2);
for ($i = 0; $i < $halgLength; $i++) {
$symbol2 = mb_substr($text, $halgLength + $halgLength - $i , 1); echo ".. $symbol1 ..\n";
echo "... $symbol2 ...\n";
if ($symbol1 == $symbol2) {
echo "$resultTrue \n";
} else {
echo "$resultFalse \n";
}
}
IDw/cGhwCmVycm9yX3JlcG9ydGluZygtMSk7Cm1iX2ludGVybmFsX2VuY29kaW5nKCd1dGYtOCcpOwoKJHRleHQgICAgICAgID0gItC/0YAg0L0g0L/Qv9C90LDQvdC/0L8g0L0g0YDQvyI7CiRyZXN1bHRUcnVlICA9ICfQv9Cw0LvQuNC90LTRgNC+0LwnOwokcmVzdWx0RmFsc2UgPSAn0L3QtSDQv9Cw0LvQuNC90LTRgNC+0LwnOwoKJHRleHQgPSBzdHJfcmVwbGFjZSgiICIsICIiLCAkdGV4dCk7CiR0ZXh0ID0gbWJfc3RydG9sb3dlcigkdGV4dCk7CgoKJGxlbmd0aCAgICAgPSBtYl9zdHJsZW4oJHRleHQpOwokaGFsZ0xlbmd0aCA9IGZsb29yKCRsZW5ndGggLyAyKTsKCmZvciAoJGkgPSAwOyAkaSA8ICRoYWxnTGVuZ3RoOyAkaSsrKSB7CiAgICAkc3ltYm9sMSA9IG1iX3N1YnN0cigkdGV4dCwgJGksIDEpOwogICAgJHN5bWJvbDIgPSBtYl9zdWJzdHIoJHRleHQsICRoYWxnTGVuZ3RoICsgJGhhbGdMZW5ndGggLSAkaSAsIDEpOwogICAgZWNobyAiLi4gJHN5bWJvbDEgLi5cbiI7CiAgICBlY2hvICIuLi4gJHN5bWJvbDIgLi4uXG4iOwogICAgCmlmICgkc3ltYm9sMSA9PSAkc3ltYm9sMikgewogICAgZWNobyAiJHJlc3VsdFRydWUgXG4iOwp9IGVsc2UgewogICAgZWNobyAiJHJlc3VsdEZhbHNlIFxuIjsKfSAKCn0KCgo=