<?php
define ('foo','');
if (defined('foo')){
if (empty(foo)){
echo "Notice: Foo Is Defined, But Does Not Carry A Value. Please Set It";
}
}
If have this current script, I am running a set of checks on defined constants which the user needs to define in the configuration page.. The problem is, the config gets shipped out with nothing defined:
define ('foo','');
and when running the script, I first check that the necessary constants are correctly defined and do carry a value.
The problem is, that I can get if the value is defined, but I cannot correctly check if it's empty.
I know with empty expects a variable passed, if i pass my defined constants into a variable, doesn't it kinda defeat the point?
<?php
define ('Foo','');
$Foo = Foo;
if (empty($Foo)){
echo "Foo Is Empty";
}
?>
Whereas I might aswell setup:
$Foo = 'Value';
$OtherConstant = 'Another';
so how can I check whether my constant is carrying a value when that is defined?