<?php

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

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

$text = mb_strtolower($text);
$words = explode(" ", $text);
$words = count($words);
$text = str_replace(" ", "", $text);

$length = mb_strlen($text);
$halfLength = floor($length/2);
$count = 0;
for ($i = 0; $i <= $halfLength; $i++) {
	if(($text[$i]) == ($text[$length-$i-1])) {
		$count++;
	}
}
if ($count == $words) {
	echo $result;
} else {
	echo "В другой раз";
}