if conditional structure process
if and else statements have been explained in the previous chapter 3.2.5. We will explain it again with the example of classmate Wang Sixong to facilitate everyone’s understanding of this chapter.
The knowledge points of this chapter are: [Simultaneous Writing Level]
Basic grammar, there should be no sloppiness, it is completely stipulated by the grammar standards. If you don’t write like this, it will be wrong!
<?php $week=date("4"); //判断星期小于6,则输出:还没到周末,继续上班..... if ($week<"6") { echo "还没到周末,继续上班....."; } ?>
We have also talked about it before, so the structure of if can be deduced into two structures based on human thinking:
//if单行判断 if(布尔值判断) 只写一句话; 后续代码 //if多行判断 if(布尔值判断){ 可以写多句话; } 后续代码