I am trying to trap errors as I hate the big long error messages that are printed over the screen and want to have more control of them.
This is my current code and I am trying to trap and then control the errors
set_error_handler('error_trapper');
function error_trapper($errno, $errstr, $errfile, $errline)
{
$errmsg = "$errno: $errstr at file $errfile, line $errline\n";
}
....
exit("There seems to be an error check $errmsg ");
But $errmsg is aways blank