I have a file named config.php, content:
define ('CLIENT_ID', 'foo');
I have a file named requiredconstants.php, content:
$aRequiredConstants = array (
'CLIENT_ID',
);
Now, I want to check, in index.php, if every value from $aRequiredConstants is defined
print_r of $aRequiredConstants returns
array (
[0] => 'CLIENT_ID',
)
echo CLIENT_ID returns foo
but when I try
foreach($aRequiredConstants as $key => $value)
if(!defined($value))
echo "NOT DEFINED";
It returns NOT DEFINED.. but why? It IS defined.
Works just fine: