note 57863 deleted from reserved.variables by mazzanet

From: Date: Sun, 25 Dec 2005 23:40:12 +0000
Subject: note 57863 deleted from reserved.variables by mazzanet
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-100706@lists.php.net to get a copy of this message
Note Submitter: phpmanual at arnaudmuller dot net ---- Tried to figure out the simplest way of getting every post, get, cookie var available while register_globals is set to off, and came to this conclusion : foreach($_GET as $key => $value) { $$key = $value; } will turn every variable in the GET array to a common variable with the same name. e.g. if you request http://myserver/myscript.php?var1=111&var2=222, adding the function in myscript.php will create 2 vars : $var1=111; $var2=222; This works with every pre-defined array, such as $_POST, $_COOKIE, and the like Hope it helps ?

« previous php.notes (#100706) next »