时间:2021-07-01 10:21:17 帮助过:7人阅读
error_reporting(E_ALL);set_error_handler(array('test', 'handle_error'));if(function_exists('ob_gzhandler')) { ob_start('ob_gzhandler');} else { ob_start();}class test { public static function handle_error($errno, $errstr, $errfile, $errline) { if($errno) { debug::system_error($errstr); } }}class debug { public static function system_error($message) { ob_end_clean(); echo $message; exit; }}echo '错误前信息
';trigger_error('错误内容');
顺便贴一下错误:
chrome浏览器下
错误 330 (net::ERR_CONTENT_DECODING_FAILED):未知错误
error_reporting(E_ALL);set_error_handler(array('test', 'handle_error'));if(function_exists('ob_gzhandler')) { ob_start('my_ob_gzhandler');} else { ob_start();}class test { public static function handle_error($errno, $errstr, $errfile, $errline) { if($errno) { debug::system_error($errstr); } }}class debug { public static function system_error($message) { ob_clean(); echo $message; exit; }}echo '错误前信息
';trigger_error('ddddddddddddddddddddddddd误内容');function my_ob_gzhandler($buffer,$mod){ header("Content-Encoding: gzip"); return gzencode($buffer, 9, FORCE_GZIP);}
PHP code?1234567891011121314151617181920212223242526272829303132333435363738394041error_reporting(E_ALL); set_error_handler(array('test', 'handle_error')); if(function_exists('ob_gzhandl……
人才啊,,,感谢