Remove warning messages in PHP


Question

I have some PHP code. When I run it, a warning message appears.

How can I remove/suppress/ignore these warning messages?

1
198
2/5/2018 4:03:32 PM

Accepted Answer

You really should fix whatever's causing the warning, but you can control visibility of errors with error_reporting. To skip warning messages, you could use something like:

error_reporting(E_ERROR | E_PARSE);
306
5/26/2012 6:32:21 PM

You can put an @ in front of your function call to suppress all error messages.

@yourFunctionHere();

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon