A palindrome number is a number which remains same when its digits are reversed.
For example, number 24142 is a palindrome number. On reversing it we?ll get the same number.
Logic:
- Take a number.
- Reverse the input number.
- Compare the two numbers.
- If equal, it means number is palindrome
Palindrome Number in PHP
Example:
Output:
Palindrome Number using Form in PHP
Example:
We'll show the logic to check whether a number is palindrome or not.
Output:
On entering the number 23432, we get the following output.
On entering the number 12345, we get the following output.
need an explanation for this answer? contact us directly to get an explanation for this answer