So what I am trying to do is read through a document that looks like this.
testA phaseA 5
testA phaseB 3
testA phaseA 4
testB phaseA 4
so right now, it's going to read through the document line by line and exploding it. I want it to be able to put the information in a multidimensional array looking something like this
-
array(
-
[0]=>testA array(
-
[0]=>phaseA = 9,
-
[1]=>phaseB = 3
-
),
-
[1]=>testB array(
-
[0]=>phaseA = 4
-
)
-
)
-
So basically, if it sees that the test and phase already exists, it just adds the number of hours to the previous number. Any help would be appreciated. I'm not sure how to go about this. A sample code would probably be helpful. Ultimately, after writing this array, I need to be able to print out the number of hours of each phase as well as the total number of hours for each test(adding up all the hours for each phase in it). Thanks so much!=)