1. @Shielding method, @ is a symbol that suppresses errors in PHP.
Even if you enable the error reporting function, you can block the error message by adding the @ symbol before the error statement. Before using @ to suppress errors, a warning error will appear.
2. error_reporting shielding method.
Before starting the php file, we can add the sentence error_reporting(0); this function means to set the error level of PHP and return the current level. 0 means disabling error reporting.
3. display_errors shielding method.
The first two methods can only work on a single line or a single file, while this one works on all PHP files. Open the php.ini file and search for display_errors = on. The default should be on, which means the error reporting function is enabled. Just change it to off.
4. error_reporting shielding method.
Before starting the php file, you can add the sentence error_reporting(0); this function means to set the error level of PHP and return the current level. 0 means disabling error reporting.
// Close all PHP error reporting error_reporting(0); ?>
The above is how to block errors in PHP. I hope it will be helpful to everyone.