This section introduces the PHP loop, and PHP's looping statements include for, While,do. While,switch, etc., in the actual programming should be the most, it is recommended that we firmly grasp. Welcome to the PHP Cycle tutorial page. 1. Break: Indicates the end of the current for, While,do. While,switch process, you can give the number, indicating the return to the first layer. Such as:
"; break;//jump out of the switch statement case 9:echo" Quto to 9. "; Break 2; Here jumps 2 layers, jumps out the while loop here the number cannot exceed its actual layer number, if writes the break 3, the system will error. Default:break;}} Echo ' over! $i = '. $i;? >
Result: Quit to 4.quto to 9.over! $i =9 2, continue statement: Jump out of this cycle of the remaining code, and judge this condition is true when the next cycle
";} echo "Over";? >
Results: $i =0$i=1$i=2$i=3$i=4$i=6$i=7$i=8$i=9$i=10$i=11$i=12over You can also add numbers after continue:
';}} echo "Over";? >
Results: $i =0$j=1$i=1$j=1over 3, goto statement: can only be in the same file or scope to jump syntax: goto tag; Tags://. Statement
Output: BB Thank you for your attention to the PHP introductory tutorial, this series of basic PHP tutorial will help PHP novice friends, quickly master the language of PHP programming. The programmer's home will continue to introduce PHP-related tutorials For everyone, I wish you all the progress of learning! |