首页 > PHP教程 > PHP应用 > 正文:学习动态网页技术PHP中错误处理的一些方法

学习动态网页技术PHP中错误处理的一些方法

web学习吧 2007-09-19 来源: 收藏本文
共7页: 上一页 [1] [2] [3] [4] [5] [6] 7 下一页 set_error_handler('error_handler');
//restore_error_handler();
set_exception_handler('exception_handler');
//restore_exception_handler();

我肯定是错误
?>

执行结果:
notice: Use of undefined constant 我肯定是错误 - assumed '我肯定是错误'在E:\web\web\php\bi\exception\m.php的第74行 Use of undefined constant 我肯定是错误 - assumed '我肯定是错误'

学习动态网页技术PHP中错误处理的一些方法

  另外,在类中,还可以这样:
    function trigger_error($error_msg, $error_type = E_USER_WARNING)
    {
        trigger_error(" error: $error_msg", $error_type);
    }


  著名的Smarty就是这么做的.
共7页: 上一页 [1] [2] [3] [4] [5] [6] 7 下一页
热点教程
实用信息推荐
网站地图 - 最新教程 - RSS订阅 - 版权所有 - 广告服务 - 友情连接 - 联系我们