How to use user error in PHP
This article describe about user_error() Function in PHP.
user_error() Function
This function create user define error message.
This function generate the trigger an error at a use-defined condition. And used with the built-in error handler, or user specified function set by the set_error_handler() function.
It is most useful function to display user-define error on the define error.
On unvalid user define error return FALSE otherwise TRUE.
Syntax
user_error (error_message, error_type)
|
Example
<html>
<body>
<?php
$test=2;
if ($test>1)
{
user_error("A custom error has been triggered");
}
?>
</body>
</html> |
Output
You may also want to read these related articles Click here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here