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
The perfect solution for professionals who need to balance work, family, and career building.
More than 10 000 certificates already issued!
The HTML Certificate documents your knowledge of HTML.
The HTML5 Certificate documents your knowledge of advanced HTML5.
The CSS Certificate documents your knowledge of advanced CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The jQuery Certificate documents your knowledge of jQuery.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
Your message has been sent to W3Schools.