Re: multi select and php
| From: | Chris Boget | Date: | Mon, 26 Apr 2004 19:47:31 +0000 |
| Subject: | Re: multi select and php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184697@lists.php.net to get a copy of this message | ||
> anybody know where i can go to get a good idea on how to take values from
a
> multi select show them on the screen and then put them in a set column
type
> in php??
If you use "[]" in the name of the form element you are using for the
multiple
select, the value is returned as an array that you can iterate through.
eg:
<html>
<form
<input type="select multiple" name="my_element[]">
</form>
</html>
<script language="php">
foreach( $_POST['my_element'] as value ) {
echo $value . '<br>';
}
</script>
Chris