我有一个带选项的选择列表。我如何使用该列表中的所有选项填充数组?
//form
<form method="post" action="popArray.php">
<select name="selectitem" multiple="multiple">
<option value="United States">United States</option>
<option value="Russia">Russia</option>
<option value="North Korea">North Korea</option>
</select>
<input type="submit" value="List">
</form>
//popArray.php
<?php
$areas = array();
//throw all the options into that array.
?>
答案 0 :(得分:0)
您需要在列表名称中添加方括号:
<select name="selectitem[]" multiple="multiple">