purencool Posted October 14, 2010 Share Posted October 14, 2010 I have four different arrays and I want to place them into a multi dimensional array and then I want to place it into a Session variable. This is what I have below.How do I do this? when I print_r($_Session) I don't get anything just option[](2); $_SESSION ['option']['green'] = array('name '=>'jeff'); $_SESSION ['option']['red'] = array('name '=>'mary'); $_SESSION ['option']['blue'] = array('name '=>'joe'); $_SESSION ['option']['brown'] = array('name '=>'ash'); Quote Link to comment Share on other sites More sharing options...
rwwd Posted October 14, 2010 Share Posted October 14, 2010 echo "<pre>"; print_r($_SESSION['option']);<-- needs the index defining I think.. echo "</pre>"; Rw Quote Link to comment Share on other sites More sharing options...
purencool Posted October 14, 2010 Author Share Posted October 14, 2010 so the multi dimesional array is correct? Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted October 14, 2010 Share Posted October 14, 2010 I have four different arrays and I want to place them into a multi dimensional array and then I want to place it into a Session variable. This is what I have below.How do I do this? when I print_r($_Session) I don't get anything just option[](2); $_SESSION ['option']['green'] = array('name '=>'jeff'); $_SESSION ['option']['red'] = array('name '=>'mary'); $_SESSION ['option']['blue'] = array('name '=>'joe'); $_SESSION ['option']['brown'] = array('name '=>'ash'); 1. $_Session is not the same as $_SESSION 2. Where are you doing a print_r(), on the same page as these variable assignments or another page? Quote Link to comment Share on other sites More sharing options...
purencool Posted October 14, 2010 Author Share Posted October 14, 2010 I don't know why I had $_Session instead of $_SESSION thanks that fixed it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.