note 21620 added to function.eval
| From: | kickflip at gmx dot li | Date: | Tue, 21 May 2002 15:17:29 +0000 |
| Subject: | note 21620 added to function.eval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-30837@lists.php.net to get a copy of this message | ||
even thoug it might be the worst way in the whole world to do it - this worked very nice for me:
reset ($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
//do something crazy with the $val
eval("\$" . "\$key = \"$val\";");
}
et voila! you have all your global vars with the value of choice.
actually this creates a new VARIABLE for each value in $keys and gives that new variable the value
$val.
--
http://www.php.net/manual/en/function.eval.php
http://master.php.net/manage/user-notes.php?action=edit+21620
http://master.php.net/manage/user-notes.php?action=delete+21620
http://master.php.net/manage/user-notes.php?action=reject+21620