zoukankan      html  css  js  c++  java
  • php自定义错误函数

    1.php是可以自定义错误处理函数的,具体的设置很简单:

    1)写一个错误处理函数,函数名自己命名,但是参数是固定的,为$errno, $errstr,其中前者默认为错误等级,后者为错误的具体信息。

    2)设置错误的处理方式。set_error_handler("你自己命名的错误处理函数。");这种方式,对于所有错误,都将以你设置的方式处理。另外如果只控制某种类型的错误处理:

    3)设置错误的处理方式。set_error_handler("你自己命名的错误处理函数。",某些固定常量);这个里面,固定常量是php设定好的,代表了不同的错误登记,具体包括:

    E_WARNING,E_NOTICE等,可参考http://www.w3school.com.cn/php/php_error.asp。在这种处理方式下,只有错误属于你写的那个固定常量类型的错误的,才会安装

    你的定义函数进行错误处理。

  • 相关阅读:
    BEC listen and translation exercise 44
    中译英12
    BEC listen and translation exercise 43
    中译英11
    BEC listen and translation exercise 42
    中译英10
    BEC listen and translation exercise 41
    中译英9
    BEC listen and translation exercise 40
    中译英8
  • 原文地址:https://www.cnblogs.com/caicai-bird/p/4408833.html
Copyright © 2011-2022 走看看