PHP if else swith for while and other writing
Follow the following rules for writing control structures:
a. In the if condition judgment, if a constant judgment condition is used, put the constant on the left side of the equal sign or inequality sign, for example:
if (6 == $errorNum), because if you miss an equal sign in the equation , the grammar checker will report an error for you, and you can quickly find the error location. Pay more attention to this kind of writing;
b. There must be a default block in the switch structure;
c. In the cyclic use of for and wiile, be careful about the use of continue and break to avoid problems similar to goto;