Conditional statements for beginners to PHP
if Judgment statement
Format: if (condition){
Execution code
}
if...else Statement
Format if (condition){
Code block 1;
}else{
Code Block 2;
}
Note: Give a variable and assign a value equal to 0 Determine whether $i is equal to 1 If equal, output the first echo statement, otherwise output the second echo statement
if...else if...else
Format: if (condition 1){
Code block 1;
}else if(condition 2){
Code block 2;
}else{
Code block 3;
}
=60 and $a<80){ echo "良好"; }else if($a>=80 and $a<90){ echo "非常好"; }else{ echo "优秀"; } ?>
##switch statement
break jump
In switch, when the break statement is encountered, Instead of executing downward, realize the jump
##