Complete PHP Error Reference
The user_error() function creates a user-defined error message.
The user_error() function is used to trigger an error message at a
user-specified condition. It can be used with
the built-in error handler, or with a user defined function set by the set_error_handler()
function.
This function is useful when you need a user-defined message to a specified
condition when running a script runtime.
This function returns FALSE if a non valid error type is specified, and TRUE otherwise.
This function is an alias of the trigger_error() function.
| Parameter | Description |
|---|---|
| error_message | Required. Specifies the error message. Limited to 1024 characters in length |
| error_types | Optional. Specifies the error type for this error message. Possible error types:
|
The output of the code above should be something like this:
Complete PHP Error Reference
Your message has been sent to W3Schools.