飞龙博客

feilong.org 前端开发教程

difference between break continue exit in php

飞龙修订于 20110208 06:49 43 次浏览

What the difference between break continue or exit in php?Here feilong give some tips and a sample.

1.continue:skip the present, to the next.
2.break:out of the loop,
3.exit out of the php

Sample,

$i = 1;while (true) {
if ($i==2) {
$i++;continue;// skip 2 and go to the next
} elseif ($i==5) {
break;// go out of the loop
} else {
echo $i . "\n>";
}
$i++;
}
exit;
echo 'continue skip present.break go out of the loop,exit ';

网址:https://feilong.org/difference-between-break-continue-exit-php
初发:20110208 06:49

想学前端?长按二维码加我微信

想学前端?点击飞龙QQ

分类: 网站开发

新作:

旧文:

关闭

长按二维码 -> 识别图中二维码

打开微信,发现,扫一扫

支付完成后,点击下一步

感谢大力支持

然后你手机号:

最后点这,稍等即可