so i have this 3-dimensional array for a scheduling program that looks like this
$rows[$x][$y][$z]
$x represents search results having the same 'code' (code is a column in the D😎
$y represents the different 'courseNum' within one 'code'
$z represents all the classes within one 'courseNum'
since this is a course scheduling proggie, i have to check everything within one result against everything else in all the other results to look for time clonflicts. thats the part im confused at, how to loop thru all that.
a lil visuals, it looks kinda like this:
(please disregard underscores as spaces)
---------$x = 0------------
ABC_123Monday ($rows[0][0][0])
ABC123Tuesday ($rows[0][0][1])
ABC474_Friday ($rows[0][1][0])
---------$x = 1---------------
DEF_873Thursday ($rows[1][0][0])
DEF090Monday ($rows[1][1][0])
DEF090_Tues ($rows[1][1][1])
---------$x = 2----------------
YUT_134Mon ($rows[2][0][0])
YUT134Fri ($rows[2][0][1])
YUT712_Tues ($rows[2][1][0])
ABC is $x, within that,
ABC 123 is $y, and within that,
ABC 123 Monday is $z
something like that. i hope its not too confusing....
users can get up to 6 results (that means $rows can have a size of up to 6, or $x can be up to 6). i'll use 3 here.
so now what the proggie should do is take one class from each result, and compare it to each other. if there are no time conflicts, then it'll be displayed in a table. it should go like this:
comparing ABC 123 - DEF 873 - YUT 134
$rows[0][0][0] - $rows[1][0][0] - $rows[2][0][0]
$rows[0][0][0] - $rows[1][0][0] - $rows[2][0][1]
$rows[0][0][1] - $rows[1][0][0] - $rows[2][0][0]
$rows[0][0][1] - $rows[1][0][0] - $rows[2][0][1]
so thats the process of one comparison. $x can be up to 6, $y can be something between 1 and 50 (or so...), $z can be something between 1 to 4.
what is the best way to loop thru everything? i tried for loops and it dont seem to be working...
THANKS EVERYBODY!