Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

PHP Error Handler Function Example

<?php
   function customError($errno, $errstr, $errfile, $errline) {
      echo "Custom error: [$errno] $errstr\n";
      echo "Error on line $errline in $errfile\n";
      echo "Ending Script";
      
      die();
   }
   
   //set error handler
   set_error_handler("customError");
   $test = 0;
   
   //trigger error
   if ($test >  -1) {
      trigger_error("A custom error has been triggered");
   }
?> 

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.