Variable scope???
Posted: Tue Feb 19, 2008 1:18 pm
I am doing a bit of PHP coding with a shopping cart software.
I have noticed that they have one file with a list of definition such as:
define('DATE_FORMAT', 'd/m/Y');
but this constant DATE_FORMAT I have seen being used by another php file without reference to the php file that defined it. So there was no require or include code line for the php file that defined DATE_FORMAT.
Does this mean that contants defined in one file are available to all other scripts without having to reference the file that defined the variable?
Thanks
I have noticed that they have one file with a list of definition such as:
define('DATE_FORMAT', 'd/m/Y');
but this constant DATE_FORMAT I have seen being used by another php file without reference to the php file that defined it. So there was no require or include code line for the php file that defined DATE_FORMAT.
Does this mean that contants defined in one file are available to all other scripts without having to reference the file that defined the variable?
Thanks