The user_error() function creates a user-defined error message in PHP

Description

The following code shows how to the user_error() function creates a user-defined error message.

Example


 /*  www  . j  a v a  2  s  . c  o m*/
  
<?php
    $test=2;
    if ($test>1){
         user_error("A custom error has been triggered");
    }
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Development »




Environment
Error
Hash
Include
Locale
Math
Network
Output
Reflection
PHP Regular Expressions