Home >Backend Development >PHP Tutorial >Introduction to php user_error() function
user_error() function creates a user-defined error message.
The user_error() function is used to trigger an error message under user-specified conditions. It can be used with the built-in error handler routine, or with a user custom function set by the set_error_handler() function.
This function is useful when you need to customize the error message under a specified condition when running the script.
If an illegal error type is specified, this function returns FALSE, otherwise it returns TRUE.
This function is an alias of the trigger_error() function.
Syntax
user_error(error_message,error_types)
Parameters | Description |
---|---|
error_message | Required. Specifies the error message. Length limit is 1024 characters. |
error_types | Optional. Specifies the error type of the error message. Possible error types:
|
The above is the detailed content of Introduction to php user_error() function. For more information, please follow other related articles on the PHP Chinese website!