Okay, here is what I am trying to do. Someone will take a quiz. The results will then be calculated by adding the value (from 1-5) of various questions together (example: question 1 has a value of 5, question 37 has a value of 4, question 73 has a value of 3). I have 18 different categories that they will be placed in based on the calculated values. I only want it to show the top 5 categories based on the calculated values. Their test results will not be stored in a database so I can't use the limit function in MySQL. I can sort the array properly but it shows all 18 categories.
So how can I limit the number of records to the top 5?