In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > I would like to get all the data from a POST-result into an array. > > Is there a function like that adds all the vars from the post into an array > where Key is the name of the form-field and Value is the value entered in > this field. > > Like this: > array('firstname' => 'fname', 'lastname' => 'lname'); > > Thanks, > // Michelle
each() From the docs: Example 125. Traversing $_POST with each() echo "Values submitted via POST method:<br />\n"; reset ($_POST); while (list ($key, $val) = each ($_POST)) { echo "$key => $val<br />\n"; } After each() has executed, the array cursor will be left on the next element of the array, or on the last element if it hits the end of the array. You have to use reset() if you want to traverse the array again using each. -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php