Inside a PHP foreach
loop, i have a variable called $levels
. This variable gives different values for each loop. The values are all numeric. The numbers will also be common across multiple instances of the loop.
So for example, a few loops may return the number 7, and others might return 4 and one might return 3. I want to be able to determine the most common numeric value generated during the loop.
Any suggestions on how this can be achieved?