note 31435 deleted from function.eval by didou

From: Date: Sat, 17 May 2003 14:46:07 +0000
Subject: note 31435 deleted from function.eval by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-48148@lists.php.net to get a copy of this message
Note Submitter: dr.mabuse@addcom.de In some examples above the following snipplet is being used: reset ($HTTP_POST_VARS); while (list ($key, $val) = each ($HTTP_POST_VARS)) { //do something crazy with the $val eval("\$" . "\$key = \"$val\";"); } Actually you don't need eval to do this! Remember that PHP has this already built in. Just use this snipplet: reset ($_POST); while (list($key,$val) = each($_POST)) { $$key = $val; } The '$$' does the job! HTH

« previous php.notes (#48148) next »