不知道怎么用
只懂得try{ }catch(){ },具体怎么用,,,不知道
只懂得try{ }catch(){ },具体怎么用,,,不知道
2015-03-19
就是捕捉异常 参考一下 下面的例子
PHP code
<?php
/*
*
* opcode number: 107
*/
try {
$error = 'Always throw this error';
throw new Exception($error);
// Code following an exception is not executed.
echo 'Never executed';
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
// Continue execution
echo 'Hello World';
?>举报