English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Error & Loggings Reference Manual
The trigger_error() function generates a user-level error/Warning/Notice information
bool trigger_error ( string $error_msg [, int $error_type] );
This function is 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) The specific error information of this error, the length is limited to 1024 bytes. Over 1024 Characters in bytes will be truncated. |
2 | error_types (optional) It specifies the error type of this error message. Possible error types-
|
If the specified error_type is incorrect, this function returns FALSE, otherwise it returns TRUE.
The following is the usage of the trigger_error function-
<?php if ($test<10) { trigger_error("The number cannot be less than10"); } ?>Test and see‹/›
Output result:
The number cannot be less than10