WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World
Sets a user-defined exception handler function

set_exception_handler

(PHP 5)

set_exception_handler Sets a user-defined exception handler function

Description

string set_exception_handler ( callback $exception_handler )

Sets the default exception handler if an exception is not caught within a try/catch block. Execution will stop after the exception_handler is called.

Parameters

exception_handler

Name of the function to be called when an uncaught exception occurs. This function must be defined before calling set_exception_handler(). This handler function needs to accept one parameter, which will be the exception object that was thrown.

Return Values

Returns the name of the previously defined exception handler, or NULL on error. If no previous handler was defined, NULL is also returned.

Examples

Example #1 set_exception_handler() example

<?php
function exception_handler($exception) {
  echo 
"Uncaught exception: " $exception->getMessage(), "\n";
}

set_exception_handler('exception_handler');

throw new 
Exception('Uncaught Exception');
echo 
"Not Executed\n";
?>

See Also


Tired to edit forms? this simple script will edit or update ANY MySQL database.It can handle set, enum, textarea and creat and update date fields data.
Categories : MySQL, Databases, PHP
PHP Youtube Downloader - This is a set of PHP functions that can be used to download movies from Youtube.com.
Categories : PHP, CURL, Regexps
'Random effect text' - This randomly select characters from a text string and changes the characters color for a short set time period.
Categories : Java Script



XMLRPC server class and handler
Categories : PHP, PHP Classes, XML
This provides a drop down form for searching with different search engines. All the encoding/arguments are set by the program as need for each supported search engine (currently 18)
Categories : HTML, Search
Record Set Paging with PHP (RSP)
Categories : PHP, MySQL, Navigation, Databases, HTML and PHP
Recordset Class like ADO Recordset (plus DataBase Splitting feature) using ODBC functions
Categories : PHP Classes, ODBC, Databases, PHP
You have a set of many resources , and You need to know wich of these resources are available for a given use during a given period but MySql does not allow SUB-Selection :( here is the right way to do that in a single query
Categories : MySQL, General SQL, Databases, Algorithms
Resetting the sequence in a mysql auto increment field.
Categories : Databases, MySQL, Beginner Guides
A set of functions to check the validity of a credit card number.
Categories : Ecommerce, Credit Cards, PHP
How to use the IIS Exception Monitor
Categories : IIS, Debugging, WinNT, Web Servers
Functions for calculating sunrise/sunset, twilight * length of day based on latitude / longituse & date
Categories : Date Time, PHP, Complete Programs
javascript cookie settings
Categories : Java Script, Beginner Guides
set file ini class - Provides a simple ini-type settings file interface. Great for saving and reading variables quick between executions.
Categories : PHP, PHP Classes, Filesystem