Range values to be calculated in PHP Loop

This question was asked by a Abdullah on stackoverflow.  So i thought of giving him a better solution.


As you can see from the above image. For a range of number, each number must be added and divided by the length to get the average and then check if the average is greater than or equal to 7.5, he need to set the is heavy value to yes if not No.

Here is the solution i gave him.

Results looks like this.

Hope this will be helpfull. Tnx.  🙂