How to hide notice errors in PHP
Posted on August 30, 2008, under PHP,
Bookmark it
Hi,
The PHP notice errors are sometimes frustrating and you are tired of seeing them when you are working on your scripts. They are showed at the beggining of your pages and may reveal confidential information to the visitor like the path to the file or the php file name (in case you are using friendly URLs).
There are cases when they are useful (for instance when you defined a constant twice or when you use a variable that hasn’t been defined), but there are situations when everything works fine on your site and you don’t really need them. Here’s the code that you should use:
error_reporting (E_ALL ^ E_NOTICE); /* 1st line (recommended) */
NOTE: Many programmers make mistakes while working on large applications so if there are cases when something is not working right on your site and you hided the notice errors, consider turning them on. They might tell you some bugs in your scripts.
Happy coding!
Do you wish to receive the latest updates as soon as they are posted? Get our RSS Feed or Subscribe to the Newsletter!
- August 30, 2008
- article by Gabriel C.
- 8 comments
Related Posts
-
Basic JS Function to Show/Hide (Toggle) an Elementat November 12, 2008 with 1 comment
-
PHP: Creating a simple web data (spider) extractorat September 14, 2008 with 11 comments
-
Create a PHP Script that Logins in to a Password Protected Areaat December 17, 2008 with 14 comments
-
PHP: Practical cURL functionat September 2, 2008 with 2 comments
-
How to Add Multi-language Support to a PHP Websiteat July 23, 2009 with 83 comments

8 Replies to "How to hide notice errors in PHP"
December 19, 2008 at 6:14 AM
thx u very much buddy!…
January 30, 2009 at 2:56 AM
that solves the problem. thank you bro. i owe you hehe.
March 27, 2010 at 10:40 PM
thankz! that really helps me! :)
May 10, 2010 at 7:23 AM
thanks ! it helps.
May 13, 2010 at 6:25 PM
Thanks mate!!!
August 13, 2010 at 1:46 PM
Thanks man!
August 13, 2010 at 1:48 PM
Thanks for your help! You rock!
October 11, 2010 at 11:08 PM
thanks greate job