note 24832 deleted from language.variables.external by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Thu, 29 Aug 2002 20:44:51 +0000 |
| Subject: | note 24832 deleted from language.variables.external by jmcastagnetto | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-36005@lists.php.net to get a copy of this message | ||
I keep forgetting this so I am putting this note here for the next time I forget!
When you want to receive data from a client in a post method as an array from a selection box use []
after the name.
e.g
//
<select name=fruits[] multiple=true size=10>
<option value=apple>apple</option>
<option value=pear>pear</option>
<option value=banana>banana</option>
//
<?PHP
//
for($i = 0; $i < count($fruits); $i++)
{
print("the value of fruits[$i] was $fruits[$i]" );
}
//
?>