PHPphp

PHP中for语句执行顺序

2015-04-19  本文已影响173人  AirFlow

实例:

<?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:推荐一首歌:《皇后大道东》——罗大佑&蒋志光

上一篇 下一篇

猜你喜欢

热点阅读