Page 1 of 1

Constants

Posted: Thu Jun 27, 2002 1:57 am
by 9902468
This might sound silly, but I'd like to know if I can check if a constant is set. I have many constants that are, or are not, set according to page displayed, user input etc. once set, the value I have to keep is always the same, so using variable would be waste of everything. I've tried isset and if clauses, but always get same notice; undefined constant constant used assuming "constant" (PHP understands it as a string?)

So, is it possible, or am I forced to use variables?

Posted: Thu Jun 27, 2002 1:59 am
by twigletmac

Posted: Thu Jun 27, 2002 2:26 am
by 9902468
Thanks! it's so easy. (when you know it....)

Posted: Thu Jun 27, 2002 2:32 am
by twigletmac
To be honest all I did was go to php.net and seach on constant, got this:
http://www.php.net/manual/en/function.constant.php
and found the function you needed from there.

Remember, the manual is your friend :wink:

Mac