This is kind of a style question, I believe:
What is the best way (or the standard way? ) to declare constants? For example, I have a php script I am using where I periodically change the name of the upload directory, so I simply declared at the top of the script:
$upload_dir="/upload1";
The idea being I change it there, and then I don't have to go through the whole progam and change every hard-coded instance of the upload directory. Simple.
But then in order to use it in a function, I have to delare:
global $upload_dir;
so I can actually use it. Kind of a pain. I've looked into the "declare" statement, but that's not really what I'm looking for either...
Also, is there a site out there that discusses PHP coding style?
thanks!