set_error_handler() method we can display custom errors by using this method eg:
echo $myvariable;
//
custom error handler
function custom_error($type, $msg, $file, $line, $context) {
switch
($type) {
//
notices
case
E_NOTICE:
print "Notice Custom Message on line $line of $file: $msg <br />"; break;
//
warnings
case
E_WARNING:
//
report error
print
"Non-fatal error Custom Message on line $line of $file: $msg <br />";
break;
//
other or fatal
default:
print
"Fatal Error
Custom Message of type $type on line $line of $file: $msg <br />"; break;
}
}
?>
No comments:
Post a Comment