如何在CodeIgniter中的单个post参数中传递多个值?
问题描述:
我使用选择的 UI库为名为'tables的post param选择多个值'。在Chrome网络控制台中,我可以检查这是否符合我的预期:
I'm using the chosen UI library to select multiple values for a post param named 'tables'. In the Chrome network console I can check that is working how I expected:
Form data
checkin:2012-06-15 16:00:00
checkout:2012-06-15 17:00:00
tables:14
tables:15
tables:16
customer:28
但是当我尝试在控制器中恢复此表格信息时
But when I try to recover this tables info in the controller
var_dump($this->input->post('tables'));
我只有参数的最后一个值:
I only got the last value for the param:
string(2) "16"
也可以尝试 var_dump($ _ POST ['tables']);
I also try var_dump($_POST['tables']);
when the same result.
答
尝试调用 tables []
而不是表
。