, , , , , , , , , , ,

Normally when working with PHP, it is a common thing that warning and notices are not shown. It is to some extend a good practice to hide all these since warnings and notices bring a negative impression from a end user. For a developer this should be something to be of greater importance. Developer should be able to identify and fix all warnings and notices, similarly as with the error messages.

Now how to display warning and notice messages from our code itself, without changing any server settings.

Add the following line of code to the start of the code;


Note, E_ALL is a constant and should not be given within quotes !!

This will list all the warnings, errors and notices which can be separately mentioned using;



There are some more useful functions;

ini_get() – This is used to get the values for different settings.

Example : echo ini_get(“display_errors”);

ini_set() – This is used to set the values.

Example : echo ini_set(“display_errors”,”1″);

ini_get_all() – This will return all the configuration options set. Note, the return type is a multi-dimensional array.