(HTML) Form element arrays


Sometimes you might want to group form elements in arrays.
Here’s a way to do that:
[html]
<form>
<input type="text" name="textboxes[]">
<input type="text" name="textboxes[]">
<input type="text" name="textboxes[]">
</form>
[/html]

The structure of the $_POST array will then be:
[php]
Array
(
[textboxes] => Array
(
[0] => value 1
[1] => value 2
[2] => value 3
)

)
[/php]

Leave a Reply

Your email address will not be published. Required fields are marked *