On Fri, 2004-05-21 at 08:37, Richard Davey wrote:
> Absolutely - and one of the best features of constants is their scope
> - being global in nature you can use them ANYWHERE which is very handy
> indeed!
ANYWHERE except in code you plan to eval().
Funny how get_defined_constants() knows about all your CONSTANTS, but
eval() doesn't.
I made this little function so I could use defined CONSTANTS in HTML
templates that get eval()'d.
function makeConstants() {
foreach(get_defined_constants() as $k=>$v) $GLOBALS[$k] = $v;
}
--
Greg Donald
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php