PHP trigger_error() Function
Complete PHP Error Reference
Definition and Usage
The trigger_error() function creates a user-defined error message.
The trigger_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.
Syntax
trigger_error(error_message,error_types)
|
| 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:
- E_USER_ERROR - Fatal user-generated run-time error. Errors that can
not be recovered from. Execution of the script is halted
- E_USER_WARNING - Non-fatal user-generated run-time warning.
Execution of the script is not halted
- E_USER_NOTICE - Default. User-generated run-time notice. The script found
something that might be an error, but could also happen when running a
script normally
|
Example
<?php
$test=2;
if ($test>1)
{
trigger_error("A custom error has been triggered");
}
?>
|
The output of the code above should be something like this:
Notice: A custom error has been triggered
in C:\webfolder\test.php on line 6
|
Complete PHP Error Reference
The Ektron Intranet
lets you do everything you need to do on your corporate intranet and everything you want to do... all with just one application.
What can you do with the Ektron Intranet? |

|
Navigate through content, documents, assets, colleagues and workgroups quickly and intuitively with enterprise search |

|
Communicate with friends and colleagues with forums, message boards and corporate blogging using the new Social Networking Platform |

|
Promote collaboration among coworkers in your organization through project workspaces where others can efficiently find information and work together |

|
Personalize your company profile by bookmarking and organizing favorite content, uploading assets, posting photos, blogging, and more |

|
Interact with features like tagging, flagging, wikis and ratings found in the Web 2.0 Toolbox |
 |
Author/edit content, manage navigation, menus, audit trails, workflow and approvals with the best in breed Content Management |
|
|
|
|
See why there are 20,000+ Ektron integrations worldwide. Request an
INSTANT DEMO or download a
FREE TRIAL today. |
|