Welcome Guest, Not a member yet? Register   Sign In
Need help with multi dimension array
#1

[eluser]vincej[/eluser]
Hi I'm new to CI / php and am struggeling to get what I need from a multi dimensional array. when I do a print_r on $_SESSION['cart'] I get a nice array:

Array
(
[20] => Array
(
[name] => Variety Pack
[price] => 120.35
[count] => 1
)

[25] => Array
(
[name] => bag of Scalops
[price] => 50.00
[count] => 1
)

)

The sub-array key ( ie 20 , 25 ) are the product ID numbers. I want to pull those out and put them into a variable like $productID.

Usually For statements are supposed to do the trick, but I just keep getting an Off Set error.

Many Many thanks if you can help - I'm pulling my hair out over this !










Theme © iAndrew 2016 - Forum software by © MyBB