我见过在 fopen
之前使用 @
的代码示例,如
$fh = @fopen($myFile, 'w');
这个@
有什么意义?
最佳答案
它抑制表达式可能显示的错误。
您可以阅读更多相关信息 here .
例子:
file_get_contents('file_does_not_exist'); //this shows an error
@file_get_contents('file_does_not_exist'); //this does not
关于php - fopen 前面有/没有@,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2531720/