daveasc Posted November 18, 2013 Share Posted November 18, 2013 Ok, I was helped with using/displaying the following array: Posted Yesterday, 10:06 AM Ok, new to PHP ... trying to figure out how to use a multidimensional array,the one shown below. The print_r works fine. But how do I use the array to show the values in another page, e.g. on the new page I want to display the "4" from the "Par" array and the "410" from the "BackYardage" array. Probably very simple but can't figure it out. Thanks. The solution was given to me ... and it works fine ... BUT... $teeboxes = array ( "Par" => array ("4","5","3","4","3","4","4","5","4","4","5","3","4","3","4","4","5","4"), "BackYardage" => array ("410","525","173","394","133","410","425","590","410","410","525","173","394","133","410","425","590","410"), "MiddleYardage" => array ("410","525","173","394","133","410","425","590","410","410","525","173","394","133","410","425","590","410"), "FrontYardage" => array ("410","525","173","394","133","410","425","590","410","410","525","173","394","133","410","425","590","410"), "ForwardYardage" => array ("410","525","173","394","133","410","425","590","410","410","525","173","394","133","410","425","590","410"), "SeniorYardage" => array ("410","525","173","394","133","410","425","590","410","410","525","173","394","133","410","425","590","410"), ); Now what I really need next is a solution to the following situation - the above is for one "team, i,e. one course .. but the team could have up to 12 other courses that similar data would be needed ... and there are 5 other teams ... my program has each team sign in so I know what team it is and Would like to be able to display the course data, pars and tee boxes, for each of the course they will be working with. Seems like somehow, reading in each teams course data (pars and yardage) when they sign in would be the way to go ... this is easy using Visual Basic but can't figure out how to do it in PHP ... is there a way to read in the multiple yardages for a signed in team? Quote Link to comment https://forums.phpfreaks.com/topic/284027-using-multiple-arrays-or-read-in-data/ Share on other sites More sharing options...
Barand Posted November 18, 2013 Share Posted November 18, 2013 Is this data from a database? If not, why not? Quote Link to comment https://forums.phpfreaks.com/topic/284027-using-multiple-arrays-or-read-in-data/#findComment-1458867 Share on other sites More sharing options...
Rifts Posted November 18, 2013 Share Posted November 18, 2013 (edited) $teeboxes['Par'][4]or$teeboxes[0][0] Edited November 18, 2013 by Rifts Quote Link to comment https://forums.phpfreaks.com/topic/284027-using-multiple-arrays-or-read-in-data/#findComment-1458882 Share on other sites More sharing options...
daveasc Posted November 18, 2013 Author Share Posted November 18, 2013 Guru: Well, it's not a database because (1) I wanted to start simple to see if my idea has possibilities and (2) I know zip about PHP database but have done an ASP one. Quote Link to comment https://forums.phpfreaks.com/topic/284027-using-multiple-arrays-or-read-in-data/#findComment-1458900 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.