PHP Custom Error functions

Source: Internet
Author: User

1.php is a custom error-handling function, and the specific settings are simple:

1) Write an error handler, the function name is named, but the parameters are fixed, for $errno, $errstr, where the former defaults to the error level, the latter is the specific information of the error.

2) Set the error handling method. Set_error_handler ("You name the error handler yourself.") This way, for all errors, will be handled in the way you set. In addition, if only one type of error handling is controlled:

3) Set the error handling method. Set_error_handler ("You name the error handler yourself.") ", some fixed constants); In this case, the fixed constants are set by PHP and represent different error registrations, including:

E_warning,e_notice, etc., can refer to http://www.w3school.com.cn/php/php_error.asp. In this way, only the error belongs to the fixed constant type of the error you wrote, it will be installed

You define the function for error handling.

PHP Custom Error functions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.