If $usernum is greater than 10, generate an error.
<?php if ($usernum>10) { trigger_error(“Number cannot be larger than 10”); } ?> |
The trigger_error() function generates a user-level error message.
It can be used with either the built-in error handler or a user-defined error handler set using the set_error_handler() function.
trigger_error(message, type) |
Parameter |
Description |
message |
Required. Specifies the error message for this error, with a maximum length of 1024 bytes. |
type |
Optional. Specifies the error type for this error. Possible values are:
|
Return Value: |
Returns |
PHP Version: |
4.0.1+ |