PHP ----- loop structure _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
PHP ----- loop structure. For loop statement print pyramid complete pyramid 25 (1; ++ (1;-; ++ nbsp; (1; * 2-1; ++ (1 |. (1 | * 2-1 .} nbsp; br} switch statement: s for loop statement

Print pyramid

Complete pyramid

      =25     (=1;<=;++                  (=1;<=-;++              ' '                   (=1;<=*2-1;++              (==1 || ==                  '.'                               (==1 || ==*2-1                      '.'                 }                      ' '                         '
' }

Switch statement:

                   

Processing when a Boolean value is encountered in the switch selection statement:

= (: "Mismatch" "1": "Successful match": "ko"

While loop and do... while loop:

    ".$i;      Paxster';  

The combination of while loop and switch selection statement:

Constant:

      ('TAX',200            Tab=100      Tab;

Compile a simple calculator:

Step 1: Write the input interface

                  

Step 2: write the computing background code

 
 

Continue statement: Skip the code after this loop. You can specify the number of layers to jump out of, for example, continue 2; two layers to jump out, similar to break 2;

Goto statement: like the C language, jump to the code with tags. the code in the middle is not executed and is ignored directly.

       (=0,=50;<100;++         (--             (==17) goto         'i=$i'     :      'i='..'j='.;

Print the complete pyramid = 25 (= 1; =; + + (= 1; =-; + + 'nbsp; '(= 1; = * 2-1; ++ (= 1 | = '. '(= 1 | = * 2-1 '. '} 'nbsp; ''' br/'} switch statement: s...

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.