1.break跳出代码片段,结束循环 2.continue结束当前片段,继续下一次循环 3.exit 结束整个PHP代码 <?php /* php的break,continue,return 的简单区别代码 */ $i = 1; while (true) { // 这里看上去这个循环会一直执行 if ($i==2) {// 2跳过不显示 $i++; continue; } else if ($i==5) {// 但到这里$i=5就跳出循循环了 break; } else { echo $i . '<br>'; } $i++; } exit; echo '这里不输出';?
详细解决方案
研究php中break,continue,exit的应用与区别
热度:696 发布时间:2012-12-20 09:53:21.0
相关解决方案
- MyEclipse错误:Java was started but returned exit code = 1
- 讨论和寻求支持:在网页的任何位置插入分页样式<div style="page-break-after: always"></div>以便分页,就跟在word中插入分页符一样效果,详情见内,该怎么处理
- 如何给asp:menu加上 Style="word-break:break-all"的属性?
- cannot find win.com,unable to continue windows,该怎么处理
- cannot find win.com,unable to continue windows.解决思路
- Tornado远程调试的有关问题:Target Server will exit
- Andrew W. Davis’s 2013 prediction - Cisco will exit the hardware-based group video conferencing
- 错误信息:could not find the main class programe will exit
- java中窗口退出时System.exit(0)和System.exit(1)有什么区别?
- [求助]问个 continue 的问题
- [求助]exit(5)是什么意思
- [求助]exit(5)是什么意思
- if isempty(menu(i,j)) then exit for 这句是什么意思?解决方法
- 求这个CSS style="page-break-before: always"准确用法
- css强行换行 word-break:break-all跟word-wrap:break-word的区别
- 研究php中break,continue,exit的应用与区别
- php break 二
- PHP的几个程序停止关键字break,return,exit
- 封装RCP ,运行出现 JVM terminated Exit code=13
- Extjs4-退出store.each() unlabelled break must be inside loop or switch
- Javascript break 跟 continue 语句与有标签的语句一起使用
- could not find the main class.Program will exit,该如何处理
- 关于for (i=0;i<10;i++){if(i%2==0)continue;该怎么处理
- Failed to install Tomcat6 service. Check your settings and permissions Ignore and continue anyway,该如何解决
- Myeclipse6.5频繁自动弹出,异常:JVM terminated. Exit code=1
- Myeclipse 异常:JVM terminated. Exit code=255
- Myeclipse 启动时报错:JVM terminated.Exit.code = -一
- eclipse启动异常:java was started but returned exit code = 1
- 关于eclipse"JVM terminated. Exit code=-1"这个有关问题
- 解决eclipse3.5 起步报错 JVM terminated. Exit code=-1