<?php

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

$resultTrue = 'Всё таки палиндром!';
$resultFalse = 'не палиндром!';

$text = "А роза упала на лапу Азора";
$text = mb_strtolower($text);
$text = str_replace(" ", "", $text);
$text2 = str_replace(" ", "", $text);

function strrev_enc($text2)
{
    $text2 = iconv('utf-8', 'windows-1251', $text2);
    $text2 = strrev($text2);
    $text2 = iconv('windows-1251', 'utf-8', $text2);
    return $text2;
}

$text2 = strrev_enc($text2);

echo "Палиндром - {$text}, Нечто совершенно иное - {$text2}.\n";

if ($text == $text2) {
   echo $resultTrue;
} else {
   echo $resultFalse;
}