Home Php PHP Error Handling Functions
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

PHP Error Handling Functions

Advertisement
PHP Error Handling Functions and example that explains how to create user defined error handling functionalists.

Though every programming language offers default error handling methods. You can also write your own error handling functions in PHP.

There is a bit difference between user defined error handling method and a default error handling techniques.

In a default error handling method, program will throw a error message with filename, error message describing the error along with the line
number where error has occurred. But in a user defined error handling you can throw a well defined error message that helps you to find and
rectify error easily.

Given are the types of PHP Error Handling Functions:

  • die() method
  • setting custom error handler and error triggering
  • error reporting

In PHP die( ) method is used to handle simple and basic errors in PHP. For example if your program is not able to find or located any file or variable then it will simply die, instead of sending an error message to user.

Where as a Custom error handler or triggering is used to trigger a error when user is not entering a desirable input.

Error reporting is a method to send an error message to the user. By default PHP sends an error message to user with line number, error message and file names. But in case of using error reporting method you can send a well defined error message to users on entering a wrong data or input.

Go through the given error handling tutorial for example code.

PHP Error Handling Example

Advertisements

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 19, 2013

Ask Questions?    Discuss: PHP Error Handling Functions  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com