Hi Im still pretty new to PHP and I want to save three different things in an array that I will be pulling through my database. For now I just need help with setting up the array. For each row of the database theres 3 things I want to sort from, the week of the year(say 43), the hours i worked that week (say 29) , and the year (say 2013). So just to set up the array I put a bunch of fake data like so:
$hours = array(
"week" => array(1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51),
"hours" => array(65,56,34,76,87,43,23,43,53,23,65,34,23,54,65,75,34,23,34,54,34,54,65,34,23,76),
"year" => array(2013,2013,2013,2013,2013,2013,2013,2013,2013,2013,2013,2013,2013,2013,2013,2013,2013,2013, 2014,2014,2014,2014,2014)
);
My first question is: Is my array set up properly for what Im trying to describe. My second question: If it is set up correctly, how could I run a foreach loop so I can access all three variables, the week of the year, the hours, and the year?