我有这样的表格
<form>
<input type="text" name="personal_details[]" />
<input type="text" name="personal_details[]" />
<input type="text" name="pictures[]" />
<input type="text" name="pictures[]" />
</form>
使用 php 我可以像这样访问数据
$name = $_POST['personal_details'][0];
$surname = $_POST['personal_details'][1];
etc.. etc
是否可以使用 codeigniter 输入类完成此任务?
最佳答案
它们的工作原理基本相同。
$personal_details = $this->input->post('personal_details');
$pictures = $this->input->post('pictures');
$name = $personal_details[0];
$surname = $personal_details[1];
关于php - 使用 codeigniter 从表单数组访问数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4794632/