实例:
<?php
for($x=0;$x<5;$x++){
echo 'The number is '.$x;
echo '<br>';
}
?>
输出结果为:
The number is 0
The number is 1
The number is 2
The number is 3
The number is 4
一共执行了五次,下面进行详解
------------------------------------------------------
For语句执行顺序
for(变量赋值①;判断代码②;变量运算④){
重复执行代码③;
}
PS:推荐一首歌:《皇后大道东》——罗大佑&蒋志光