<?php
$resultTrue = 'Всё таки палиндром!';
$resultFalse = 'не палиндром!';
$text = "А роза упала на лапу Азора";
function strrev_enc($text2)
{
$text2 = iconv('utf-8', 'windows-1251', $text2); $text2 = iconv('windows-1251', 'utf-8', $text2); return $text2;
}
$text2 = strrev_enc($text2);
echo "Палиндром - {$text}, Нечто совершенно иное - {$text2}.\n";
if ($text == $text2) {
echo $resultTrue;
} else {
echo $resultFalse;
}
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7Cm1iX2ludGVybmFsX2VuY29kaW5nKCd1dGYtOCcpOwoKJHJlc3VsdFRydWUgPSAn0JLRgdGRINGC0LDQutC4INC/0LDQu9C40L3QtNGA0L7QvCEnOwokcmVzdWx0RmFsc2UgPSAn0L3QtSDQv9Cw0LvQuNC90LTRgNC+0LwhJzsKCiR0ZXh0ID0gItCQINGA0L7Qt9CwINGD0L/QsNC70LAg0L3QsCDQu9Cw0L/RgyDQkNC30L7RgNCwIjsKJHRleHQgPSBtYl9zdHJ0b2xvd2VyKCR0ZXh0KTsKJHRleHQgPSBzdHJfcmVwbGFjZSgiICIsICIiLCAkdGV4dCk7CiR0ZXh0MiA9IHN0cl9yZXBsYWNlKCIgIiwgIiIsICR0ZXh0KTsKCmZ1bmN0aW9uIHN0cnJldl9lbmMoJHRleHQyKQp7CiAgICAkdGV4dDIgPSBpY29udigndXRmLTgnLCAnd2luZG93cy0xMjUxJywgJHRleHQyKTsKICAgICR0ZXh0MiA9IHN0cnJldigkdGV4dDIpOwogICAgJHRleHQyID0gaWNvbnYoJ3dpbmRvd3MtMTI1MScsICd1dGYtOCcsICR0ZXh0Mik7CiAgICByZXR1cm4gJHRleHQyOwp9CgokdGV4dDIgPSBzdHJyZXZfZW5jKCR0ZXh0Mik7CgplY2hvICLQn9Cw0LvQuNC90LTRgNC+0LwgLSB7JHRleHR9LCDQndC10YfRgtC+INGB0L7QstC10YDRiNC10L3QvdC+INC40L3QvtC1IC0geyR0ZXh0Mn0uXG4iOwoKaWYgKCR0ZXh0ID09ICR0ZXh0MikgewogICBlY2hvICRyZXN1bHRUcnVlOwp9IGVsc2UgewogICBlY2hvICRyZXN1bHRGYWxzZTsKfQ==