English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Error & Loggings Reference Manual
user_error() function
bool user_error ( string $error_msg [, int $error_type] );
This function is an alias of trigger_error(), used to trigger user error conditions, and can be used with built-in error handlers or user-defined functions set as new error handlers (set_error_handler()).
Serial number | Parameters and descriptions |
---|---|
1 | error_msg (required) It specifies the error message. Limited to1024characters. |
2 | error_types (optional) It specifies the error type of this error message. Possible error types-
|
If an incorrect error_type is specified, this function returns FALSE; otherwise, it returns TRUE.
The following is the usage of this function-
<?php if ($test<10") { user_error("The number cannot be less than10"); } ?>
Output result:
The number cannot be less than10