<!DOCTYPE html>
<html>
<body>
<?php
$start = 10;
$end = 50;
echo "Palindrome numbers between $start and $end: <br>";
for($start=$start; $start<=$end; $start++)
{
$copyNum = $start;
$reverse = 0;
// reverse a number
while($copyNum != 0)
{
$reverse = $reverse * 10;
$reverse = $reverse + ($copyNum % 10);
$copyNum = floor($copyNum / 10);
}
// result
if(($start == $reverse) && ($start != 0))
{
$flag = 1;
echo "$start ";
}
}
if($flag == 0)
echo "There is no palindrome number between the given range";
?>
</body>
</html>