RE: [PHP] Variable variables

From: Date: Tue, 13 Mar 2001 13:46:51 +0000
Subject: RE: [PHP] Variable variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-43657@lists.php.net to get a copy of this message
Okay, that makes a little sense, but isn't there some sort of collection that will do the same thing (coming from vb). -----Original Message----- From: Jason Stechschulte [mailto:jpstech@unoh.edu] Sent: Tuesday, March 13, 2001 6:38 AM To: John Meyer Cc: php-general@lists.php.net Subject: Re: [PHP] Variable variables 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>

« previous php.general (#43657) next »