• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Handle $_POST[ ][ ] arrays

#1
[eluser]Unknown[/eluser]
Hi there,

I know this has been discussed earlier.
Even though this code is working, I´m sure that this is not the best solution - am I right?

Controller:
Code:
$count = 3
    function save()
    {
        for ($i=0; $i < $count; $i++)
        {
            $persons = array
            (
                'Firstname'  => $_POST['Firstname'][$i],
                'Lastname'   => $_POST['Lastname'][$i],
                'Gender'     => $_POST['Gender'][$i]
            );
            $this->personModel->save($persons);
        }
    }

Thanks.


Messages In This Thread
Handle $_POST[ ][ ] arrays - by El Forum - 04-13-2010, 12:49 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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