如何在CodeIgniter中的单个post参数中传递多个值? [英] How to pass several values in a single post parameter in CodeIgniter?
本文介绍了如何在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 []
而不是表
。
这篇关于如何在CodeIgniter中的单个post参数中传递多个值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文