define a global constant in php
by Prakash[ Edit ] 2013-10-05 10:41:14
We can define a global constant in php using the following way :
define('MYCONSTANT','myvalue');
This constant can be used inside functions and classes also. Trying to change this value will leads to error. It is a good practice to use global constants wherever necessary.