<?php
header("Content-Type: text/plain; charset=utf-8");
$text = 'А муза рада музе без ума да разума';
$lengthStr--;
$saveLenght = $lengthStr;
$check = 0;
for ($i = 0; $i <= $saveLenght; $i ++) {
$firstSymbol = mb_substr($textWithoutSpace, $i, 1); $lastSymbol = mb_substr($textWithoutSpace, $lengthStr, 1); $lengthStr --;
if ($firstSymbol == $lastSymbol) {
$check ++;
}
}
$saveLenght ++;
echo "Исходный текст: {$text}. \n";
if ($check == $saveLenght) {
echo 'Палиндром';
} else {
echo 'Не Палиндром';
}
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7Cm1iX2NoZWNrX2VuY29kaW5nKCd1dGYtOCcpOwpoZWFkZXIoIkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIpOwoKJHRleHQgPSAn0JAg0LzRg9C30LAg0YDQsNC00LAg0LzRg9C30LUg0LHQtdC3INGD0LzQsCDQtNCwINGA0LDQt9GD0LzQsCc7CgokdGV4dFVwcGVyID0gbWJfc3RydG91cHBlcigkdGV4dCk7CiR0ZXh0V2l0aG91dFNwYWNlID0gc3RyX3JlcGxhY2UoIiAiLCAiIiwgJHRleHRVcHBlcik7CiRsZW5ndGhTdHIgPSBtYl9zdHJsZW4oJHRleHRXaXRob3V0U3BhY2UpOwokbGVuZ3RoU3RyLS07CiRzYXZlTGVuZ2h0ID0gJGxlbmd0aFN0cjsKJGNoZWNrID0gMDsKCmZvciAoJGkgPSAwOyAkaSA8PSAkc2F2ZUxlbmdodDsgJGkgKyspIHsKICAgICRmaXJzdFN5bWJvbCA9IG1iX3N1YnN0cigkdGV4dFdpdGhvdXRTcGFjZSwgJGksIDEpOwogICAgJGxhc3RTeW1ib2wgPSBtYl9zdWJzdHIoJHRleHRXaXRob3V0U3BhY2UsICRsZW5ndGhTdHIsIDEpOwogICAgJGxlbmd0aFN0ciAtLTsKICAgIGlmICgkZmlyc3RTeW1ib2wgPT0gJGxhc3RTeW1ib2wpIHsKICAgICAg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