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 Link to comment https://forums.phpfreaks.com/topic/207342-how-to-convet-into-2-dimension-array/ 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 Link to comment https://forums.phpfreaks.com/topic/207342-how-to-convet-into-2-dimension-array/#findComment-1084071 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 Link to comment https://forums.phpfreaks.com/topic/207342-how-to-convet-into-2-dimension-array/#findComment-1084391 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? Link to comment https://forums.phpfreaks.com/topic/207342-how-to-convet-into-2-dimension-array/#findComment-1084392 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? Link to comment https://forums.phpfreaks.com/topic/207342-how-to-convet-into-2-dimension-array/#findComment-1084397 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.