This article mainly introduces the use of PHP custom error handling, examples of PHP through the use of custom function error handling skills, the need for friends can refer to the following
The examples in this article describe the use of custom error handling in PHP. Specific as follows:
<?phperror_reporting (e_all); function ErrHandler ($errorno, $errorstr, $errorfile, $errorline) {$display = true; $notify = false; $halt _script = false; $error _msg = "<br>the $errorno error is occurring at $errorline $errorfile <br>"; Switch ($errorno) {case E_user_notice:case e_notice: $halt _script = false; $notify = true; $label = "<B>Notice</B>"; Break Case E_user_warning:case e_warning: $halt _script = false; $notify = true; $label = "<b>Warning</b>"; Break Case E_user_error:case e_error: $label = "<b>fatal error</b>"; $notify =true; $halt _script = false; Break Case E_parse: $label = "<b>parse error</b>"; $notify =true; $halt _script = true; Break Default: $label = "<b>unknown error</b>"; Break if ($notify) {$msg = $label. $error _msg; Echo $msg; } if ($halt _script) exit-1;} $error _handler = Set_error_handler ("ErrHandler"); echo "<BR≫
Summary : The above is the entire content of this article, I hope to be able to help you learn.