david212 Posted July 10, 2010 Share Posted July 10, 2010 how to create a 2 dimension array for this: : Jan : Feb : Mar : Apr : May : Jun : Jul : Aug : Sept thank you Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted July 10, 2010 Share Posted July 10, 2010 Please give an example of what you want the array to contain. You're question is not very clear. Ken Quote Link to comment Share on other sites More sharing options...
david212 Posted July 11, 2010 Author Share Posted July 11, 2010 here it is what i created: <?php $arr = array("1"=>"Jan", "2"=>"Feb", "3"=>"Mar","4"=>"Apr","5" => "May","6" => "Jun","7" => "Jul","8" => "Aug","9" => "Sept"); echo "<pre>"; foreach($arr as $month=>$item) { echo "$month: $item\n"; } echo "</pre>"; ?> i want to list all months using 2 dimension array Thank you Quote Link to comment Share on other sites More sharing options...
xcasio Posted July 11, 2010 Share Posted July 11, 2010 How exactly (in what context?) will you be using a two-dimensional array? How do you want to access the month array? Quote Link to comment Share on other sites More sharing options...
david212 Posted July 11, 2010 Author Share Posted July 11, 2010 this is what i do not understand. it is my home task. i had to crate it in assosiative array and my instrucotr told me create it in 2d array and i don't know how to do it . Any suggestion? 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.