Page 1 of 1

Dynamic use of constants

Posted: Mon Jun 25, 2007 10:02 am
by shiznatix
I have constants that look like this:

USERS_RAKETRACKING_JANUARY
USERS_RAKETRACKING_FEBUARY
etc.

and I am trying to dynamically call them in a loop as I loop through the months like this:

Code: Select all

USERS_RAKETRACKING_.$val
but of course that does not work. so I was wondering if that I am trying to do is even possible or if I need to go about this another way.

Posted: Mon Jun 25, 2007 10:07 am
by volka

Code: Select all

constant('USERS_RAKETRACKING_'.$val)

Posted: Mon Jun 25, 2007 2:19 pm
by Ambush Commander
You may want to consider stuffing these "constant" values into a registry.

Posted: Mon Jun 25, 2007 3:52 pm
by Ollie Saunders