Thanks for your reply...but I don't quite completely understand it yet.
I have been able to retrieve/generate a two dimensional array that appears to contain all the data I need. When I do a "print_r' of my array $BoxArray it gives me back:
Array ( [0202S] => Array ( [0] => 4 [1] => 22.25 [2] => 58.5 [3] => 93.75 [4] => 126 ) [0203S] => Array ( [0] => 1 [1] => 50.75 [2] => 76.5 [3] => 104.25 [4] => 139 ) [0205S] => Array ( [0] => 11 [1] => 65 [2] => 82 [3] => 108 [4] => 163 ) [0211S] => Array ( [0] => 5 [1] => 35.5 [2] => 68 [3] => 99 [4] => 125 ) [02WS] => Array ( [0] => 9 [1] => 30.5 [2] => 59 [3] => 92 [4] => 112 ) )
(The codes for SEASON are the key/values that look like [0202S] etc.)
I need to rework this output into two other arrays: $datay and $datax that must be like this:
//one element for each tick mark
$datax = array(0202S,0203S,0205S,0211S,02WS)
//five elements for each corresponding box/whisker chart element
$datay = array(4,22.25,58.5,93.75,126,1,50.75,76.5,104.25,139,11,65,82,108,163,5,35.5,68,99,125,9,30.5,59,92,112)
However, at the moment, the best I can get is like this:
array(0202S,0203S,0205S,0211S,02WS,) with a peksy trailing comma, because I am extracting the data with a "foreach" loop that looks like this:
$datax = "array(";
foreach ($PhaseArray as $Phase) {
$datax .= $BoxArray[$Phase][5].",";
}
$datax .= ")";
(note that I'm using yet another array ($PhaseArray) to get the Phase (SEASON) values....I'm sure it's not necessary, but this is the best I've been able to figure out so far).
I know I am supposed to be using a for/if/else loop to close the last parenthesis and avoid the trailing comma but I am confused as to how to accomplish this with a two-dimensional array.
I imagine I'll figure it out eventually, but if anyone has a shortcut that helps me simplify the code, I'd appreciate it.