Second, PHP Process Control structure
Branching structure:
Single conditional branching structure bidirectional conditional branching structure multi-directional conditional branching structure nested conditional branching structure
if (expression) {if (expression) {if (expression) {if (expression) {
... if (an expression) {
}}else{elseif (expression) {...
... ... }
}} elseif (expression) {
----------------if (expression) {
switch (expression) {...
}else{
Case value 1: ...
... }
Break }
Case Value 2:
...
Break
Case Value 3:
...
Break
Default
...
}
Loop structure:
While statement: Do...while statement: For statement:
while (expression) {do{for (initialization; conditional expression; increment) {
... ... ...
}}while (expression); }
Special Process Control Statements:
Break: Interrupts the current loop, which is the execution of the end loop
Continue: can only be used inside the loop, the function is to skip the cycle, perform the Next loop
Exit: Exit the current script directly, regardless of the structure
PHP Basic Knowledge Point Summary (ii)