使用codeigniter从post数组中获取数据

I'm trying to post an array that is name="std_id[]" from view page.But in controller while trying to print the array using print_r($std_id) I can't find any data. The code is given below..

In view page:

<?php
foreach ($all_student as $v_student) {
?>
<tr><td style="display:none"><input type="text" value="<?php echo $v_student->std_id ?>" name="std_id[]"></td>
<td class="center"><?php echo $v_student->std_name; ?></td>
<?php }?>

In controller function:

$std_id = $this->input->post("std_id[]", true);
print_r($std_id);
exit();

You are referencing the input name wrong. You need to change the line

$std_id = $this->input->post("std_id[]", true);

With:

$std_id = $this->input->post("std_id", true);