Welcome Guest, Not a member yet? Register   Sign In
Multidimensional array read-out in view
#3

[eluser]Unknown[/eluser]
I belive you want to have a multidimensional foreach loop that loops the numbers to, like:
Code:
foreach($var as $key => $val) {
   echo $key.'\n';
}
And this should return:
Code:
0
1
So what I figured out tonight is that you have to assign you multidimentional array with an own key when you pass the data to the view.

So you have to make sure you pass the vars to the view something like this:
Code:
[vars] => Array
        (
            [voornaam] => Sandy
            [achternaam] => Cohen
            [adres] => Somefancystreet 69
            [gemeente] => Orange County
            [tel] => 1000
            [mail] => [email protected]
            [stad] => California
            [postcode] => 17459
            [factuurnummer] => 1
            [datum] => 2007
            [betaald] => 1
            [loop] => Array
                (
                    [0] => Array
                        (
                            [id] => 1
                            [factuurnummer] => 1
                            [referentienummer] => ee
                            [omschrijving] => dfds
                            [aantal] => 2
                            [eenheidsprijs] => 10
                        )
                    [1] => Array
                        (
                            [id] => 2
                            [factuurnummer] => 1
                            [referentienummer] => fgg
                            [omschrijving] => fdgf
                            [aantal] => 8
                            [eenheidsprijs] => 20
                        )
                )
        )


Messages In This Thread
Multidimensional array read-out in view - by El Forum - 08-11-2007, 07:20 PM
Multidimensional array read-out in view - by El Forum - 08-12-2007, 01:20 AM
Multidimensional array read-out in view - by El Forum - 08-12-2007, 03:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB