Page 1 of 1

Populating a Hash from $_POST

Posted: Thu Aug 14, 2003 2:09 pm
by anya
I'm a php newbie, how do I fill a hash with the field names and values of the $_POST global?

Posted: Thu Aug 14, 2003 5:23 pm
by qartis
Not sure what you mean by populating a hash, but to access the names and values of all variables parrsed through POST, one would use..

Code: Select all

foreach($_POST as $name => $value){
echo "\$_POST['$name'] equals $value<br />\r\n";
// $name, $value are available
}