<?php

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

$text = "zalupasszalupa";
$result;

$text = str_replace(" ", "", $text);
$text = mb_strtolower($text);

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

for ($i = 0; $i <= $halfLenght; $i ++) {
	$a = mb_substr($text, $i, 1);
	$b = mb_substr($text, -$i, 1);
	echo "$a -- $b \n";
	if ($a != $b) {
		$result = "Не палиндром";
	} else {
		$result = "Палиндром";
	}
}
echo "{$result}";