RE: Re[2]: [PHP] Variables in variable names
| From: | Matt Schroebel | Date: | Wed, 09 May 2001 14:12:23 +0000 |
| Subject: | RE: Re[2]: [PHP] Variables in variable names | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-52109@lists.php.net to get a copy of this message | ||
> or even try
> <input type="text" name="name[]">
> <input type="text" name="name[]">
>
> This should AFAIK result in an Array, but I'm not sure if
> empty fields are put in.
You will get the empty fields except for checkboxes. For checkboxes only the checked elements come
through so you need values that determine which box was checked. So say you have:
<input type="checkbox" name="box[]" value="box_1" >
<input type="checkbox" name="box[]" value="box_2" checked>
<input type="checkbox" name="box[]" value="box_3" checked>
$box[0] == "box_2"
$box[1] == "box_3"