note 27650 added to function.each

From: Date: Sat, 14 Dec 2002 00:05:33 +0000
Subject: note 27650 added to function.each
Groups: php.notes 
Request: Send a blank email to php-notes+get-40891@lists.php.net to get a copy of this message
This is almost stating the obvious, but especially for new users or those migrating to the newer PHP versions where register_globals is defaulted to OFF now. Simply put this at the top of all pages that require form data input and you won't have to go recode everything by prefixing the $_POST in front of it. reset ($_POST); while (list ($key, $val) = each ($_POST)) { //echo "$key => $val<br>\n"; $$key = $val; } basically it's mapping all the $_POST keys to a variable of their same name and then assigning the $_POST value to the new variable we just created. -- http://www.php.net/manual/en/function.each.php http://master.php.net/manage/user-notes.php?action=edit+27650 http://master.php.net/manage/user-notes.php?action=delete+27650 http://master.php.net/manage/user-notes.php?action=reject+27650

« previous php.notes (#40891) next »