RE: [PHP] Possibly more of an html question, but...
| From: | Millaway, John | Date: | Mon, 03 Jul 2000 21:47:50 +0000 |
| Subject: | RE: [PHP] Possibly more of an html question, but... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-4580@lists.php.net to get a copy of this message | ||
> Try something like this:
> <select name="select_test[]" multiple>
> <option value="selection_1">Number 1
> <option value="selection_2">Number 2
> <option value="selection_3">Number 3
> ...
> <option value="selection_n">Number n
> </select>
>
> HTML supports an array datatype(sort of).
It's purely a PHP thing. If php sees the name of the variable as "foo[]" it
creates an array in variable "$foo", and populates it with each value
corresponding to the parameter named "foo".
The query string could look like this:
http://www.bar.com/blah.php4?foo[]=bar&foo[]=whatever&foo[]=blah
-John