RE: [PHP] need form array help
| From: | Chris W. Parker | Date: | Mon, 01 Mar 2004 20:03:46 +0000 |
| Subject: | RE: [PHP] need form array help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-179189@lists.php.net to get a copy of this message | ||
Brian V Bonini <mailto:b-bonini@cox.net>
on Monday, March 01, 2004 11:45 AM said:
> That make sense except the rendered form is to the effect of:
[snip]
ok i see... so you want to account for the possibility that each rider
might have a different state? said differently, you don't want all the
riders to have the same edit_rider_action?
in that case i think php turns form elements with [] on the end of them
into regular arrays. example:
<?php
$edit_rider_action = $_GET['edit_rider_action'];
?>
you then access it just like any other array:
<?php
foreach($edit_rider_action as $key => $value)
{
echo "$key, $value<br/>\n";
}
$action_cnt = count($edit_rider_action);
for($ictr = 0; $ictr < $action_cnt; $ictr++)
{
echo "$ictr, {$edit_rider_action[$ictr]}<br/>\n";
}
?>
does that help?
chris.