Re: getting an array out of the POST array
| From: | Matt M. | Date: | Tue, 17 Aug 2004 21:51:40 +0000 |
| Subject: | Re: getting an array out of the POST array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-194095@lists.php.net to get a copy of this message | ||
> while (list ($key, $val) = each ($_POST[firstname])){
> $_POST[firstname][$key] = trim($_POST[firstname][$key]);
> $_POST[middlename][$key] = trim($_POST[middlename][$key]);
> $_POST[lastname][$key] = trim($_POST[lastname][$key]);
you might be able to get this one yourself. I prefer a foreach
(http://us3.php.net/foreach) to loop over arrays, anyway, just do a
print_r($_POST) on the page you want to do the inserting from. That
should give you an idea of what is in the array and how to get to the
values you want to get too.
If you are still having troubles post the output of print_r and I can
give you a hand.