PHP get error message method, PHP get error message
The example in this article describes how PHP obtains error information. Share to everyone for your reference. Specific as follows:
function Error_reg () {$ar =array ( e_error = ' error ', e_warning = ' WARNING ', e_parse = ' prase ', e_notice = ' NOTICE '); Register_shutdown_function (function () use ($ar) { $ers =error_get_last (); if ($ers [' type ']!=8 && $ers [' type ']) { $er = $ar [$ers [' type ']]. $ers [' type ']. ': '. ' '. $ers [' message ']. ' = '. $ers [' file ']. ' Line: ' $ers [' line ']. ' '. Date (' y-m-d h:i:s '). " \ n "; Error_log ($er, 3, '/tmp/php_error.log '); } }); Set_error_handler (function ($a, $b, $c, $d) use ($ar) { if ($a!=8 && $a) { $er = $ar [$a]. $a. ': ' $b. ' = ' . $c. ' line: '. $d. '. Date (' y-m-d h:i:s '). " \ n "; Error_log ($er, 3, '/tmp/php_error.log '); } },e_all ^ e_notice);}
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/1034254.html www.bkjia.com true http://www.bkjia.com/PHPjc/1034254.html techarticle PHP Get error message method, PHP get error message This article describes how PHP gets the error message. Share to everyone for your reference. Specific as follows: function Error_reg () {...