PHP Do While loop instance, phpdowhile instance _php tutorial

Source: Internet
Author: User

PHP Do While loop instance, phpdowhile instance


The Do-while loop is very similar to the while loop, except that the do-while guarantees that it must be executed once, while the while is not possible when the expression is not true.

The Do-while loop has only one syntax:

do {   statement}while (expr)

Example:

 
  

The example is also output from 1 to 10.

Original address: http://www.manongjc.com/php/php_while.html

Read about PHP:

PHP strlen () Gets the length of the string

PHP strnatcasecmp () compares two strings (not case sensitive)

PHP strnatcmp () uses a natural algorithm to compare two strings

PHP strpbrk () finds any one of the specified characters in a string

PHP strrchr () finds the last occurrence of a string in another string

PHP Strrev () reverses the string and reverses the string

http://www.bkjia.com/PHPjc/1130669.html www.bkjia.com true http://www.bkjia.com/PHPjc/1130669.html techarticle The php Do While loop instance, the Phpdowhile instance Do-while loop and the while loop are very similar, except that the Do-while guarantee must be executed once, while the while is possible when the expression is not true ...

  • 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.