Raven wrote:
Opinions please. I'd like to hear the pro's and con's of
define('BASENAME',dirname($_SERVER['PHP_SELF']));
or
$basename = dirname($_SERVER['PHP_SELF']);
I know that one pro is that the constant can't be changed which is my
ultimate goal, but I solicit your comments.
A tiny little 'con' might be that you can do
"long string $basename long string"
with a variable, but you must do
'long string ' . BASENAME . ' long string'
with the constant.
But I really don't think that is important.
A pro is that constants are global: with a variable you must do:
$basename = dirname($_SERVER['PHP_SELF']);
function blah() {
global $basename;
... $basename ...
}
but with a constant you do:
define('BASENAME',dirname($_SERVER['PHP_SELF']));
function blah() {
... BASENAME ...
}
JP
--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.