Home >> PHP >> How can find number is palindrome or not in PHP

How can find number is palindrome or not in PHP

$n=12321;

$reverse=0;

while($n!=0){

     $reverse=$reverse*10;

     $reverse=$reverse+$n%10;

     $n=$n/10;

}

if($n==$reverse){

     echo "Palidrom";

}else{

    echo "Not Palidrom";

}

Post Your Comment

Next Questions
How can check number prime number or not
Fibonacci series
Fibonacci series using recursive
Print number 1 to 10 without loop
How can i sort array ascending order without function
How can i sort array descending order without function
How can find max difference between two elements from an array
How can find min difference between two elements from an array
How can find average from an array
How can find max element from an array
How can find min element from an array
How to connect mysql database with php
Remember password
How can find reverse string without function
How can find reverse word of string without function
How can print reverse string and show in array without function
How to insert data from mysql database
How to update data from mysql database
How to delete data from mysql database
How to list data from mysql database
error_reporting
error_reporting(E_ALL)
What is object oriented programming (oops)
What is class
What is object

Copyright ©2022 coderraj.com. All Rights Reserved.