trigger_error(): Generates a user-level error/warning/notice message
This creates user level error messages.
<?Php
$price_sell=100;
$price_buy=120;
if($price_sell<=$price_buy){
trigger_error("Do you want to sell without profit?");
}
?>
Output
Notice: Do you want to sell without profit? in C:\xampp\htdocs\t\checking.php on line 5
We can manage the error level also.
trigger_error("Do you want to sell without profit?",E_USER_ERROR);
Output
Fatal error: Do you want to sell without profit? in C:\xampp\htdocs\t\checking.php on line 5
User-generated notice message.
trigger_error("Do you want to sell without profit?",1024);
Output
Notice: Do you want to sell without profit? in C:\xampp\htdocs\t\checking.php on line 5
Syntax
trigger_error(string $message, int $error_level = E_USER_NOTICE)
user_error(): This function is an alias of: trigger_error()
← Introduction to PHP Managing Error →
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com