<input name="foo[]" ... >
I've used these before, but I'm wondering what it is called and if there is a specification for it?
I couldn't find it in the HTML 4.01 Spec and results in various Google results only call it an "array" along with many PHP examples of processing the form data.
As far as I know, there isn't anything on the HTML specs because browsers aren't supposed to do anything different for these fields. They just send them as they normally do and PHP is the one that does the parsing into an array, as do other languages.
It's just PHP, not HTML.
It parses all HTML fields with [] into an array.
So you can have
and when submitted, PHP will make $_POST['food'] an array, and you can access its elements like so:
or to see all values selected:
Anyhow, don't think there is a specific name for it
Follow it...
There are some references and pointers in the comments on this page at PHP.net:
Torsten says
Jetboy says