<?php

error_reporting(-1);
mb_internal_encoding('utf-8');

$text = "А роза упала на лапу Азора";
$result;

$text = str_replace(" ", "", $text);
$text = mb_strtolower($text);

$lenght = mb_strlen($text);
$halfLenght = floor($lenght / 2);

for ($i = 1; $i <= $halfLenght; $i ++) {
	if (mb_substr($text, $i -1, 1) != mb_substr($text, -$i, 1)) {
		$result = "Не палиндром";
		break;
	} else {
		$result = "Палиндром";
	}
}
echo "{$result}";