我希望我的通知停止在PHP中显示.在代码中没有错误,它只是说未定义的索引.什么都无法做到.
那么如何阻止它显示呢?
Notice: Undefined variable: username in C:\wamp\www\watchedit\includes\config.php on line 37
Notice: Undefined variable: key in C:\wamp\www\watchedit\includes\config.php on line 42
Run Code Online (Sandbox Code Playgroud)
小智 25
这将以编程方式关闭环境通知 - 来自PHP.net.
// Report all errors except E_NOTICE
error_reporting(E_ALL ^ E_NOTICE);
Run Code Online (Sandbox Code Playgroud)
在某些地方,您可以在声明前加上"@",如果它引起通知,它将使该位置静音.