fucntion findReverseNumber($number){ $reverse_number = 0; while ($number != 0) { $reverse_number = $reverse_number * 10 + $number % 10; $number = ($number/ 10); } return $reverse_number; } echo findReverseNumber(15145);
How PHP Reverse Number Program Works?
It is very easy to reverse a number using PHP string function strrev().
But here i will show you without using strrev() function.