<?php
mb_internal_encoding ('utf-8');
$text = "А роза упала на лапу Азора";
$text1=mb_strtolower($text);
//$chars = preg_split('//', $text1, -1, PREG_SPLIT_NO_EMPTY);
str_replace(" ","",$text1);
$count = mb_strlen($text1);
$hall = floor($count/2);
$k=0;
for ($i=0;$i<=$hall;$i++){
	$symbol1 = mb_substr($text1,$i,1);
	$symbol2 = mb_substr($text1,($count-$i),1);
	if($symbol1 == $symbol2){
		$k+=1;
	}
}
if($k==$hall){
	echo"Палиндром";
	
}
if($k!=$hall){
	echo"Не палиндром";
}
