会员登录 | 会员注册 | 意见建议 | 网站地图

站长资源综合门户

当前位置:首页 > 站长学院 > 编程程序 > 分享几个非常有用的PHP代码片段

分享几个非常有用的PHP代码片段

时间:2012-02-27 09:30:58   作者:   来源:   点击:

// Either echo an error message, or kill the entire project. Up to you...

// The code below ensures that we only "die" if the error was more than

// just a NOTICE.

if ( ($number !== E_NOTICE) && ($number < 2048) ) {

die("There was an error. Please try again later.");

}

}

// We should use our custom function to handle errors.

set_error_handler('nettuts_error_handler');

// Trigger an error... (var doesn't exist)

echo $somevarthatdoesnotexist;

分享到:

网友评论

热门编程程序