Christopher Bergin Posted December 2, 2012 Share Posted December 2, 2012 I noticed that some examples in the last chapter included If Conditionals that check the status of an array value: if (isset($_SESSION['cart'][$pid])) I tried to include this language in a For Loop but was rudely rebuffed by the interpreter: foreach ($_SESSION['cart'][$pid] as $index) just wondering. Link to comment Share on other sites More sharing options...
HartleySan Posted December 2, 2012 Share Posted December 2, 2012 I'm a little confused by your question, but is $_SESSION['cart']['pid'] an array? If not, you can't run a foreach loop on it. Link to comment Share on other sites More sharing options...
Larry Posted December 3, 2012 Share Posted December 3, 2012 The for loop should be on just $_SESSION['cart']. 1 Link to comment Share on other sites More sharing options...
Recommended Posts