<select id="industryExpect" multiple="multiple"> <option value="1">item1</option> <option value="2">item2</option> <option value="3">item3</option> ... </select>
我看到的是:
industryExpect = 13&安培; industryExpect = 17&安培; industryExpect = 19
比方说,同一个KEY有多个值,
如何从PHP中的$_POST中检索它们?
最后给它命名为[],例如:
原文链接:https://www.f2er.com/php/137738.html<select id="industryExpect" name="industryExpect[]" multiple="multiple"> <option value="1">item1</option> <option value="2">item2</option> <option value="3">item3</option> </select>
然后在$_POST数组中,您将获得所有选定选项的数组:
// assuming that item1 and item3 were selected: print_r($_POST['industryExpect']); /* array ( 0 => 1 1 => 3 ) */