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
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| Download XML Editor |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|