Here are all the data thus far:

2/13/2013,15:26:9,condition 4,5,endline
2/13/2013,15:28:9,condition 2,3,endline
2/13/2013,15:40:47,condition 3,5,endline
2/13/2013,15:41:1,condition 3,4,endline
2/13/2013,15:41:17,condition 1,1,endline
2/14/2013,9:53:14,condition 4,5,endline
2/14/2013,10:33:38,condition 4,5,endline
2/14/2013,10:33:52,condition 1,5,endline
2/14/2013,10:33:56,condition 3,2,endline
2/14/2013,12:32:13,condition 1,5,endline
2/15/2013,12:6:53,condition 2,4,endline
2/15/2013,12:7:4,condition 2,3,endline
2/15/2013,12:7:11,condition 2,3,endline
2/15/2013,12:7:11,condition 1,4,endline
2/15/2013,12:7:14,condition 1,4,endline
2/15/2013,12:7:15,condition 3,1,endline
2/15/2013,12:7:15,condition 1,5,endline
2/15/2013,12:7:19,condition 1,5,endline
2/15/2013,12:7:19,condition 1,4,endline
2/15/2013,12:7:23,condition 3,1,endline
2/15/2013,12:7:23,condition 1,5,endline
2/15/2013,12:7:26,condition 1,2,endline
2/15/2013,12:7:29,condition 1,4,endline
2/15/2013,12:7:31,condition 3,5,endline
2/15/2013,12:7:35,condition 3,5,endline
2/15/2013,12:7:38,condition 2,3,endline
2/15/2013,12:7:39,condition 3,5,endline
2/15/2013,12:7:40,condition 1,5,endline
2/15/2013,12:7:41,condition 1,1,endline
2/15/2013,12:7:44,condition 3,3,endline
2/15/2013,12:7:49,condition 3,2,endline
2/15/2013,12:7:53,condition 2,2,endline
2/15/2013,12:7:57,condition 1,1,endline
2/15/2013,12:56:11,condition 4,5,endline
2/16/2013,15:14:23,condition 2,5,endline
2/20/2013,13:43:49,condition 3,3,endline
2/21/2013,15:44:59,condition 2,3,endline
2/22/2013,1:37:30,condition 2,3,endline
2/22/2013,1:37:37,condition 2,5,endline
3/21/2014,11:8:55,condition 1,3,endline
11/5/2014,11:35:4,condition 2,3,endline
11/5/2014,11:35:20,condition 1,5,endline


Here is the content of the data file, represented in the array $theData_byrow. Notice that each element of the array contains a string that represents the ENTIRE ROW of data for a person. Within each folder in the array, we have the information we need (separated by commas), but it is all represented as a single string. We'll need to explode the data one more time (within persons) to extract the comma-delimited information.

Array ( [0] => 2/13/2013,15:26:9,condition 4,5,endline [1] => 2/13/2013,15:28:9,condition 2,3,endline [2] => 2/13/2013,15:40:47,condition 3,5,endline [3] => 2/13/2013,15:41:1,condition 3,4,endline [4] => 2/13/2013,15:41:17,condition 1,1,endline [5] => 2/14/2013,9:53:14,condition 4,5,endline [6] => 2/14/2013,10:33:38,condition 4,5,endline [7] => 2/14/2013,10:33:52,condition 1,5,endline [8] => 2/14/2013,10:33:56,condition 3,2,endline [9] => 2/14/2013,12:32:13,condition 1,5,endline [10] => 2/15/2013,12:6:53,condition 2,4,endline [11] => 2/15/2013,12:7:4,condition 2,3,endline [12] => 2/15/2013,12:7:11,condition 2,3,endline [13] => 2/15/2013,12:7:11,condition 1,4,endline [14] => 2/15/2013,12:7:14,condition 1,4,endline [15] => 2/15/2013,12:7:15,condition 3,1,endline [16] => 2/15/2013,12:7:15,condition 1,5,endline [17] => 2/15/2013,12:7:19,condition 1,5,endline [18] => 2/15/2013,12:7:19,condition 1,4,endline [19] => 2/15/2013,12:7:23,condition 3,1,endline [20] => 2/15/2013,12:7:23,condition 1,5,endline [21] => 2/15/2013,12:7:26,condition 1,2,endline [22] => 2/15/2013,12:7:29,condition 1,4,endline [23] => 2/15/2013,12:7:31,condition 3,5,endline [24] => 2/15/2013,12:7:35,condition 3,5,endline [25] => 2/15/2013,12:7:38,condition 2,3,endline [26] => 2/15/2013,12:7:39,condition 3,5,endline [27] => 2/15/2013,12:7:40,condition 1,5,endline [28] => 2/15/2013,12:7:41,condition 1,1,endline [29] => 2/15/2013,12:7:44,condition 3,3,endline [30] => 2/15/2013,12:7:49,condition 3,2,endline [31] => 2/15/2013,12:7:53,condition 2,2,endline [32] => 2/15/2013,12:7:57,condition 1,1,endline [33] => 2/15/2013,12:56:11,condition 4,5,endline [34] => 2/16/2013,15:14:23,condition 2,5,endline [35] => 2/20/2013,13:43:49,condition 3,3,endline [36] => 2/21/2013,15:44:59,condition 2,3,endline [37] => 2/22/2013,1:37:30,condition 2,3,endline [38] => 2/22/2013,1:37:37,condition 2,5,endline [39] => 3/21/2014,11:8:55,condition 1,3,endline [40] => 11/5/2014,11:35:4,condition 2,3,endline [41] => 11/5/2014,11:35:20,condition 1,5,endline )

Let's try to break this down within a person by using a foreach loop to sort through each element of the array. We will print the 3rd element for each person. (Don't forget that PHP starts counting at 0.) This value in the dataset represents the person's rating of the photo on a 1 to 5 scale.

The 3rd value for row 0 is 5.
The 3rd value for row 1 is 3.
The 3rd value for row 2 is 5.
The 3rd value for row 3 is 4.
The 3rd value for row 4 is 1.
The 3rd value for row 5 is 5.
The 3rd value for row 6 is 5.
The 3rd value for row 7 is 5.
The 3rd value for row 8 is 2.
The 3rd value for row 9 is 5.
The 3rd value for row 10 is 4.
The 3rd value for row 11 is 3.
The 3rd value for row 12 is 3.
The 3rd value for row 13 is 4.
The 3rd value for row 14 is 4.
The 3rd value for row 15 is 1.
The 3rd value for row 16 is 5.
The 3rd value for row 17 is 5.
The 3rd value for row 18 is 4.
The 3rd value for row 19 is 1.
The 3rd value for row 20 is 5.
The 3rd value for row 21 is 2.
The 3rd value for row 22 is 4.
The 3rd value for row 23 is 5.
The 3rd value for row 24 is 5.
The 3rd value for row 25 is 3.
The 3rd value for row 26 is 5.
The 3rd value for row 27 is 5.
The 3rd value for row 28 is 1.
The 3rd value for row 29 is 3.
The 3rd value for row 30 is 2.
The 3rd value for row 31 is 2.
The 3rd value for row 32 is 1.
The 3rd value for row 33 is 5.
The 3rd value for row 34 is 5.
The 3rd value for row 35 is 3.
The 3rd value for row 36 is 3.
The 3rd value for row 37 is 3.
The 3rd value for row 38 is 5.
The 3rd value for row 39 is 3.
The 3rd value for row 40 is 3.
The 3rd value for row 41 is 5.

The average rating for people is 3.62.