Error Reporting / Debug Notice - turn on / off in php script

Print

If you are getting error reports or notices in your php scripts, they can be turn off by either making changes to php.ini on the server or to the script itself.

If you want to make it stop showing errors through making changes to the script, you can simply add following code to the beginning of that page, this will stop it from showing errors.

To remove all error reports, use this:

error_reporting(0);

To turn off only Notices, use this:

$ebits = ini_get('error_reporting');
error_reporting($ebits ^ E_NOTICE);