Hay - -- (oats)
Playing some more with PHP. Boxed myself into a corner where I need
to do a macro substitution-type of capability. For example, I have
bunches of variables like this:
...
$Q02_buzz
$Q02_fuzz
$Q02_suzz
$Q03_buzz
$Q03_fuzz
$Q03_suzz
...
I need to tease out the value of Q08_fuzz, knowing the naming
convention and that I am at "08." In Fox, one could:
Stringly = "$Q"+padl(8,2,"0")+"_fuzz"
? &Stringly or
? (Stringly) or
? eval(Stringly) depending on the situation.
I need to do the same thing in PHP. The PHP eval() function seems
like the right one from the description, but I can't get it to work
without an error (parse error, unexpected $end ... It seems to want
to eval() a whole script.)
Anybody know if there is an equivelant?
(BTW: I am just making up the example, so please don't take the
variable design seriously and suggest starting from an array or
something.)
I'd ask a PHP group, but I don't know if anybody else would
understand a "macro substitution."
Ken
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.