get the two largest numbers from an array

4 years 1 month ago #96339 by security_man
security_man created the topic: get the two largest numbers from an array
i have six result equation question types, how would i write an equation to the the two largest of those six?

my first thought is to use the asort php function. i see that it is not supported natively so there is a custom javascript function that will produce the same results and i see how to add asort to the em_core_helpler.php file, but i cant figure out how to construct the array in the first place. then i am not sure how to get the first two elements in the array for use in other equations.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now