$$ Variable?

From: Date: Thu, 13 Feb 2003 02:24:29 +0000
Subject: $$ Variable?
Groups: php.general 
Request: Send a blank email to php-general+get-135380@lists.php.net to get a copy of this message
I'm trying to piece apart someone's code to see exactly what it is they're trying to do - This code was written for PHP 3.x, so it's not quite as nice as 4 (with $_POST, $_GET, $_SESSION, etc). There's this one part in particular that I have no idea what's trying to be done: if (isset ($cookie)) { while (list ($name, $value) = each ($cookie)) { $$name = $value; } } I'm assuming the $cookie array has cookie info stored in it, and it's trying to pull the data out of the array. The 2 parts of this I don't really understand are lines 2 and 3, 3 in particular. I'm guessing it's assigning $name the index, $value the element - What's really stumping me here though is the $$name = $value. What is a variable with $$ in front of it signify, and what is this trying to do? Any thoughts on this one? Thanks.

« previous php.general (#135380) next »