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


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    Post your comments , suggestion , error , requirements etc here





    PHP video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer