CodeIgniter Forums
how to get post array - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: how to get post array (/showthread.php?tid=23312)



how to get post array - El Forum - 10-06-2009

[eluser]Dimitar Velkov[/eluser]
Hi I have a problem how to get post array data.

Example of what I need:
Code:
<input name="data[]" />
<input name="data[]" />
<input name="data[]" />
<input name="data[]" />
and now how to get this data in to the controller

something like this
Code:
$array = $this->input->post('data');

for ($i=0; $i<count($array); $i++) {
    echo $array[$i];
}



how to get post array - El Forum - 10-06-2009

[eluser]wabu[/eluser]
Hi, that should work. Are you seeing an error message?


how to get post array - El Forum - 10-06-2009

[eluser]BrianDHall[/eluser]
Throw a var_dump on $array - what does it tell you?