note 55276 deleted from language.variables.variable by danbrown

From: Date: Wed, 24 Jun 2009 16:54:29 +0000
Subject: note 55276 deleted from language.variables.variable by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-157401@lists.php.net to get a copy of this message
Note Submitter: crap at anitechnic dot com ---- I was trying to move a script from one server to the next, on the first server the $_GET and $_POST were auto declared, but not on the second. rather than writing out $var = $_POST['var'] a million times I made this script that will turn anything GET'ed or POSTed into a variable. $getar = $_GET; $getkeys = array_keys($getar); for($i=0; $i<count($getkeys); $i++){ $k = $getkeys[$i]; $v = $getar[$k]; ${$k}=$v; } $getar = $_POST; $getkeys = array_keys($getar); for($i=0; $i<count($getkeys); $i++){ $k = $getkeys[$i]; $v = $getar[$k]; ${$k}=$v; } hope it helps. James

« previous php.notes (#157401) next »