How to check number/string is Palindrome number in php

Today I am talking to you about the Palindrome number in Php. First of all, we do not know what is called a palindrome number sting. For example, if any world is reversed and the value is reversed, it is equal to the Palindrome number in Php. For example, abba 1222 121 abbas. It is shown in.

<?php
    $str = "121";
    $strrev = strrev($str);
    if($str == $strrev){ 
        echo 'yes'; 
    }else{
        echo 'no';
        } 
?>

DIFFERENT CODE

<?php 
function palindrome($input) { 
    $middle = strlen($input) / 2;
    $firstHalf = substr($input, 0, floor($middle));
    $secondHalf = substr($input, ceil($middle));
    return $firstHalf == strrev($secondHalf);
    } echo palindrome("racecar") ? "Palindrome" : "Not a palindrome";
?>

What is a palindrome of 89?

A palindrome is a number whose value is equal to that of the front or back, such as 121. This number will be the same for whatever you read. The number 89 is not the number of palindromes. If you want to check the palindrome, you can visit this site http://palindrome-number-checker.com/

How do you create a palindrome number?

One thing you need to keep in mind is to create a palindrome number. That is, you have to find some numbers that, if done together, are 2 or 3. A palindrome number can only be created if it is a number that has the same value when calculated from the front or the back

How do you tell if a number is a palindrome?

I mean the first number and if I look at Pison’s man then I can understand that it is a palindrome number. Give an example and you will understand. 121 is a number now it’s a palindrome number. How do I know if you reverse the number. Of course not, because 121 turns 121 is the palindrome number. There are many more such palindrome numbers such as 11,8,55. If you are a developer then you can use the above code to create Palindrome Generate website. The code is too short for anyone to understand

1 thought on “How to check number/string is Palindrome number in php”

  1. Pingback: Noscript tag - BWD

Leave a Comment