php do while

来源:互联网 发布:淘宝专柜代购5折可信吗 编辑:程序博客网 时间:2024/06/15 17:01

php do while 

先执行do,在判断while


源码:

<?php

$x = 1;

do {

echo "x is :<br>";

$x++;

}while($x<=5);


$y = 6;

do {

echo "y is :<br>";

$y++;

} while ($y<=5);

?>

输出:

x is 1 

x is 2 

x is 3 

x is 4 

x is 5 

y is 6

0 0
原创粉丝点击