RE: [PHP] Variable variables

From: Date: Tue, 13 Mar 2001 15:31:38 +0000
Subject: RE: [PHP] Variable variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-43667@lists.php.net to get a copy of this message
Hey, there are also arrays, these can do much more and can be used most of the times you think of var-var solution... Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) maxim@phpbeginner.com www.phpbeginner.com -----Original Message----- From: John Meyer [mailto:john_meyer@geocities.com] Sent: Tuesday, March 13, 2001 10:47 PM To: Jason Stechschulte Cc: php-general@lists.php.net Subject: RE: [PHP] Variable variables 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> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#43667) next »