飞龙博客

feilong.org 前端开发教程

difference between break continue exit in php

飞龙更新于 2011-02-08 06:49 加入书签 CTRL+D 有 82 个朋友来过

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 ';

维护小站,感谢赞赏。
联系飞龙,请转淘宝

飞龙初发:
2011-02-08 06:49
本文更新网址:
https://feilong.org/difference-between-break-continue-exit-php

所在目录: 网站开发

新作:

旧文:

  • html css js
  • angular react vue
  • flutter python