title: Check whether an integer is palindrome or not in PHP?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/199184/how-do-i-check-if-a-number-is-a-palindrome">How do I check if a number is a palindrome?</a>  </p>
  </blockquote>
  
  
  
  <p>If an integer is to not allowed to be treated a string and typecasting is not allowed, how can we figure out whether the number is palindrome or not(in PHP)? </p>
  
  <p>The program which I have come up with is:</p>
  
  <pre><code>function checkPalindrome($number){
      $reverse_number = 0;
      $number_backup  = $number;
      while($number &gt; 0){
        $reverse_number = $reverse_number * 10 + $number % 10;
        $number /= 10;
      }
      return $reverse_number == $number_backup;
  }
  </code></pre>
  
  <p>At step "$number/=10", the result generated won't be integer which is creating the problem.</p>