Blogger Information
Blog 57
fans 0
comment 0
visits 46966
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
for while do~while 循环
藍錄的博客
Original
561 people have browsed it

实例

<?php
/**
 * while(): 入口判断型
 * do ~ while(): 出口判断型
 */

for ($i=0; $i<10; $i++) {
    echo $i<9 ? $i.',' : $i;
}

echo '<hr>';

// while()

$i=10; //初始化条件
while($i<10) {
    echo $i<9 ? $i.',' : $i;
    $i++;  //更新条伯
}
echo '<hr>';

//do ~ while()
$i=10; //初始化条件
 do {
    echo $i<9 ? $i.',' : $i;
    $i++;  //更新条伯
} while($i<10);

运行实例 »

点击 "运行实例" 按钮查看在线实例

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post