Php > Errors and Logging sample source codes
Error Handler
Error Handler FATAL [$errno] $errstr
\n"; echo " Fatal error in line ".$errline." of file ".$errfile; echo ", PHP ".PHP_VERSION." (".PHP_OS.")
\n"; echo "Aborting...
\n"; exit(1); break; case ERROR: echo "
ERROR
[$errno] $errstr
\n"; break; case WARNING: echo "
WARNING
[$errno] $errstr
\n"; break; default: echo "Unkown error type: [$errno] $errstr
\n"; break; } } // function to test the error handling function scale_by_log ($vect, $scale) { if ( !is_numeric($scale) || $scale <= 0 ) trigger_error("log(x) for x <= 0 is undefined, you used: scale = $scale", FATAL); if (!is_array($vect)) { trigger_error("Incorrect input vector, array of values expected", ERROR); return null; } for ($i=0; $i
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage