<?php

error_reporting(-1);

$text = "A roza upala na lapu Azora";
$result = "palindrom";
$newText = "";
$textLength = strlen($text);

for ($i = 0; $i < $textLength; $i++) {
   if ($text[$i] != " ") {
   $newText = $newText . $text[$i];
   }	
}
$newText = strtolower($newText);

$newTextLength = strlen($newText);



for ($j = 0; $j < $newTextLength; $j++) {

    $lost = $newText[$newTextLength - 1];
    $first = $newText[$j];
    
    if ($first != $lost) {
    	echo "ne palidrom";
    } else {
    	$lost--;
    	$first++;
    }
    
    

}
echo "palidrom";




