PHP output Two numbers in the middle of a palindrome number

Source: Internet
Author: User
This article mainly introduces the PHP output two numbers in the middle of how many palindrome number of methods, the case analysis of the concept of palindrome number and related judgment skills, the need for friends can refer to the next

This example describes how many palindrome numbers are in the middle of a PHP output of two digits. The specific analysis is as follows:

"Palindrome number" is a number. such as: 98789, this number is reading is 98789, the reading is 98789, is reading the same, so this number is palindrome number.

<?php for ($i =10; $i <100; $i + +) {    $len =strlen ($i);    $l =1;    $k =intval ($len)/2+1;   for ($j =0; $j < $k; $j + +) {    if (substr ($i, $j, 1)!=substr ($i, $len-$j -1,1))     $l =0;     Break }if ($l ==1) echo $i. ' <br> ';}? >

Summary : The above is the entire content of this article, I hope to be able to help you learn.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.