$error_name=array(
E_WARNING => 'Warning',
E_NOTICE => 'Notice',
E_USER_ERROR => 'User Error',
E_USER_WARNING => 'User Warning',
E_USER_NOTICE => 'User Notice',
E_STRICT => 'Runtime Notice',
);
function error_handler($errno, $errstr, $errfile, $errline, $errcontext) {
global $error_name;
$errfile=substr($errfile, strlen($_SERVER['DOCUMENT_ROOT']));
echo "$error_name[$errno]: $errstr in $errfile on line $errline
\n";
}
set_error_handler('error_handler');