Easy Tutorial
❮ Func String Mb_Strlen Php Mysql Order By ❯

PHP user_error() Function



Definition and Usage

The 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 or with a user-defined function set by the set_error_handler() function.

If an invalid error type is specified, the function returns FALSE; otherwise, it returns TRUE.

This function is an alias of the trigger_error() function.

Syntax

Parameter Description
error_message Required. Specifies the error message. The length is limited to 1024 characters.
error_types Optional. Specifies the error type for the error message. Possible error types: E_USER_ERROR - User-generated runtime fatal error. Unrecoverable error. Stops script execution. <br> E_USER_WARNING - User-generated runtime non-fatal warning. Script execution does not stop. <br> E_USER_NOTICE - Default. User-generated runtime notice. The script found something that could be an error, but may also occur during normal script execution.

Example

The output of the above code is as follows:


❮ Func String Mb_Strlen Php Mysql Order By ❯