PHP函数和@functions

基本上,我已经看到人们在他们的函数调用之前使用@ ,而不是每个函数,但是对于某些类型的扩展函数,如file_get_contents()mysql_connect()等等。

是的,问题是:为什么函数调用之前存在这些@ s?

换句话说, @file_get_contents() file_get_contents()file_get_contents()之间有什么区别?


@是一个错误控制操作员。 基本上它抑制了错误。


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


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

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

上一篇: PHP functions and @functions

下一篇: 'At' symbol before variable name in PHP: @$