Re: Variable variables
| From: | Jason Stechschulte | Date: | Tue, 13 Mar 2001 13:38:00 +0000 |
| Subject: | Re: Variable variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-43655@lists.php.net to get a copy of this message | ||
On Tue, Mar 13, 2001 at 06:36:10AM -0700, John Meyer wrote:
> Okay, I read about this feature in the php manual. What I can't figure out
> is why in the world would anybody want to use this feature? Not to start a
> flame war, just would like an explanation of why this feature is useful.
I've really only used them once, but they were handy for that situation.
I had a column in a mysql table that was a set column of user
privileges, and I wanted to register every value in the set as a session
variable.
<horridcode>
for($i = 0; $i < sizeof($privs); $i++) {
$$privs[$i] = 1;
session_register($privs[$i]);
}
</horridcode>
--
Jason Stechschulte
jpstech@unoh.edu
--
I surely do hope that's a syntax error.
-- Larry Wall in <199710011752.KAA21624@wall.org>