Home about IT Motivation Course Sales Project About Me

Sunday, July 17, 2011

How to turn off error reporting in php

If you want to turn off any errors and warning from displaying in the web page, The easiest way is to modify the php.ini file. But what if you want to turn off error reporting in php using your php code? you can accomplish this easily using php built in function error_reporting()

<?php
error_reporting(0); // Turn off all error reporting
?>
or

ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);


or

error_reporting (E_ALL ^ E_NOTICE);


or at php ini, un remark below script
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED

No comments: