PHP的for循环

For循环执行代码块指定的次数,或者当指定的条件为真时循环执行代码块.for循环用于您预先知道脚本需要运行的次数的情况

for(初始值;条件;增量)

要执行的代码;

<html>
<body>
<?php
for ($i=1; $i<=5; $i++)

 {

  echo "The number is " . $i . "<br>";

 }
?>
</body>
</html>
输出:

The number is 1
The number is 2
The number is 3
The number is 4
The number is 5
原文地址:https://www.cnblogs.com/web928943/p/12460533.html