Populating a Hash from $_POST

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
anya
Forum Newbie
Posts: 1
Joined: Thu Aug 14, 2003 2:09 pm

Populating a Hash from $_POST

Post by anya »

I'm a php newbie, how do I fill a hash with the field names and values of the $_POST global?
qartis
Forum Contributor
Posts: 271
Joined: Sat Dec 14, 2002 4:43 pm
Location: BC, Canada
Contact:

Post 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
}
Post Reply