I see some code th开发者_如何学编程at looks like this:
if(@$_POST['myvar'])
What does the @ sign do in this instance?
It suppresses any warnings/notices/errors from being printed. For instance, if $_POST['myvar'] we're undefined, PHP may output an Undefined index notice. The @ prevents that behavior.
That being said, it is considered bad practice to arbitrarily suppress warnings. You can, instead, check for the variable being set with if (isset($_POST['myvar']) && $_POST['myvar'])
http://www.php.net/manual/en/language.operators.errorcontrol.php
It suppresses any and all error messages, warnings, or notifications caused by the expression you've prepended it to. In this case: if(@$_POST['myvar']) it is probably being used because the original author did not want a notification to be emitted if $_POST['myvar'] is unset.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论