Android programmers learn PHP development (10)-process control-PhpStorm

Source: Internet
Author: User
Process control: sequential structure, branch structure (select structure), and cyclic structure. Process control: sequential structure, branch structure (select structure), and cyclic structure.

 "; // Iwanghang Android}/** 1.2, bidirectional condition branch structure (else) */if (1 = 1) {echo" iwanghang xixi
"; // Iwanghang xixi} else {echo" iwanghang haha
";} If (1 = 2) {echo" iwanghang 666
";} Else {echo" iwanghang 777
"; // Iwanghang 777}/** 1.3, multi-direction condition branch structure (elseif, switch) */$ a = 1; if ($ a = 3) {echo "iwanghang 333
";} Elseif ($ a = 2) {echo" iwanghang 222
";} Elseif ($ a = 1) {echo" iwanghang 111
"; // Iwanghang 111} else {echo" a is not 1, 2, 3
";} Switch ($ a) {case 3: echo" a = 3
"; Break; case 2: echo" a = 2
"; Break; case 1: echo" a = 1
"; // A = 1 break; default: echo" a is not 1, 2, 3
";}$ B = 33; // Here you can try to assign values 3, 33, and 333 to B. check the printed result switch ($ B) {case 3: case 33: case 333: echo "B meets one of 3, 33, and 333
"; // B meets either of 3, 33, and 333 break; case 2: echo" B = 2
"; Break; case 1: echo" B = 1
"; Break; default: echo" B is not 1, 2, 3
";}/** 1.4, nest condition branch structure */$ name =" iwanghang "; $ sex =" man "; $ age = 18; if ($ sex = "man") {echo "{$ name} is the old man
"; // Iwanghang is old man if ($ age> 60) {echo" {$ name} retired ". ($ age-60)." year
";} Else {echo" {$ name} and ". (60-$ age)." retired
"; // Iwanghang still has 42 years of retirement} else {echo" {$ name} is a veteran
";}

The above is the content of PHP Development (10)-process control-PhpStorm for Android programmers. For more information, see PHP Chinese website (www.php1.cn )!

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.