Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Eval, Variable Variables problem
January 3, 2007, 7:49 pm
rate this thread
I would like to set a value for the corresponding 'switch type' variable.
For example, if $x is 14, I want to execute the following statement:
$switch_14 = "on";
In general, I want something like this:
$switch_.$x = "on";
I know I could build a switch/case structure since the values for $x are
known and there are only a dozen or so of them, but it would seem more
elegant and/or compact to do it another way.
I've looked at eval() and variable variables and can't seem to get anything
I've also read the quote "If eval is the answer, you're asking the wrong
Thanks for any help you can provide.