<?php
error_reporting(-1);
mb_internal_encoding('utf-8');

$text = "А роза упала на лапу Азора";
$resultTrue = 'палиндром';
$resultFalse = 'не палиндром';

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

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

for ($i = 0; $i < $halfLenght; $i++) {
	$symbol1 = mb_substr($text2, $i, 1);
	$symbol2 = mb_substr($text2, -($i+1), 1);
	echo "1 {$symbol1}\n";
	echo "2 {$symbol2}\n";
}