PHP functions and @functions

Basically, I've seen people using @ before their function calls, not for every function, but for some kind of extension functions like file_get_contents() , mysql_connect() and so on.

And yes, the question is: For what purpose are there these @ s before function calls?

Or in other words, what is the difference between @file_get_contents() and file_get_contents() ?


@ is an error control operator. Basically it's suppressing errors.


这是PHP的error control operator用于抑制函数调用产生的任何错误。


@function不会在其HTML输出中显示任何错误消息,而常规函数调用将会发生。

链接地址: http://www.djcxy.com/p/1732.html

上一篇: 我应该在我的PHP代码中使用@吗?

下一篇: PHP函数和@functions