programming-examples/php/Basics/Palindrome number Program in PHP.php

24 lines
249 B
PHP
Raw Normal View History

2019-11-18 14:44:36 +01:00
<?php
$p=121;
while((int)$num!=0)
{
$rem=$num%10;
$sum=$sum*10+$rem;
$num=$num/10;
}
if($sum==$p)
{
echo $p," is palindrome number";
}
else
{
echo $p." is not palindrome number";
}
?>
/*
Output
121 is palindrome number