This code snippet can be used to trap errors in your PHP scripts. The main function is GetErrorDescription, it takes five arguments, the error type, the error message, the file the error occurred in, the line number where the error occurred, and an array containing the variables initialized and available at the time of the error. Each of these parameters is provided by PHP whenever an error occurs. The function returns HTML content that can be displayed on the page, saved to a file, e-mailed to the webmaster, or anything else that you can think of! |