<?php

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


$text = 'А роза упала на лапу Азора';
$result = 'Палидром';
$wrongResult = 'Не палиндром';

mb_strtolower($text);
str_replace(' ','',$text);

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


for($i = 0; $i <= $halfLenght; $i++) {
	$firstHalf = mb_substr($text, 0, $i);
	$secondHalf = mb_substr($text, -$i);
	if ($firstHalf == $secondHalf) {
		echo $result;
	}
	else {
		echo $wrongResult;
	}
	
}