【发布时间】:2018-10-19 10:36:10
【问题描述】:
我的 html 视图中有下一个多个字段:
<select multiple="multiple" name="search[cpuUsage[]]"
id="search_cpu_usage"
class="form-control">
{% for statu in status %}
<option value="{{ statu }}">{{ statu }}</option>
{% endfor %}
</select>
我需要用户选择的所有可能值,我尝试保存在search[cpuUsage[]] 中,但这不起作用,因为php 只获取最后选择的值。如果我只使用 cpuUsage[] 而不使用 search[] 效果很好。
为了发送到服务器,我使用jquery.serialice。
知道如何工作search[cpuUsage[]]
【问题讨论】:
-
cpuUsage[]已经是一个数组了,为什么还需要search数组?