Use of loop statements in PHP process control

Use of loop statements

Student Wang needs to travel back and forth between Beijing and Dalian repeatedly, which is a typical loop structure. Assume that Mr. Wang Si’s investment in this project requires 100 round trips to Dalian, and Mr. Wang will count each round trip. Should we write the same code a hundred times? Obviously it is impossible for programmers with extremely high IQs to handle this.

We abstracted this kind of human thinking. We define a loop structure

'; //每次执行让$count+1,这样的话,就不会产生$count永远小于100的情况了 $count++; //循环结束 } echo '后续代码'; ?>

We can add a special code logic diagram for the while loop:

2.png

#
Continuing Learning
||
'; //每次执行让$count+1,这样的话,就不会产生$count永远小于100的情况了 $count++; //循环结束 } echo '后续代码'; ?>
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!