• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to get post array

#1
[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];
}

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

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.