try catch
来源:互联网 发布:数据分析师培训哪家好 编辑:程序博客网 时间:2024/05/16 08:08
try {if (file_exists('test_try_catch.php')) {require ('test_try_catch.php');} else {echo 'AA'."</br>";throw new Exception('file is not exists');//抛出异常'file is not exists'}} catch (Exception $e) {echo '11333';echo $e->getMessage();//如果异常--会接收上面抛出的异常,输出上面设定的'file is not exists'//异常后,会输出AA和11333//如果抛出了一个异常,try语句中的脚本将会停止执行,然后马上转向执行catch语句中的脚本。}
感谢:http://developer.51cto.com/art/200912/166409.htm
感谢:http://www.jb51.net/article/57688.htm
0 0
- try catch
- try{} catch{}
- try catch
- try...catch
- try{} catch(...){}
- try catch
- try-catch
- try catch
- try-catch
- try catch
- try catch
- try catch
- try catch
- try catch
- try {...} catch (){....}
- try{} catch{}
- try catch
- Try catch
- 常用正则表达式大全!(例如:匹配中文、匹配html)
- 03-Lucene中的搜索再搜索分页
- Logback配置与使用,网上资料自己测试整理
- 实习阶段总结1
- swif中字符串
- try catch
- 嵌入式软件开发培训笔记——linux操作系统扫盲
- Facebook推出强大Android图片库Fresco
- Android logcat
- 分布式与集群的区别
- java线程:Atomic(原子的)
- js 定时器
- 64位处理器进行32位at&t汇编-编译与连接
- Redis的安装