I'm currently using an IF statement to find out which variable I have is the highest by comparing each variable to each other, but this only works as long as 2 aren’t the highest and the same value. I need to be able to find out which variable is the highest value, and if there is more than 1, which 2 or 3 etc are the highest. I'm not really sure the best approach for this, maybe put the variables into an array and sort the array? But I can't get my head around how to find out if there are 2 the same value that are highest.
For example:
With something like that, how can I find which variable is the highest?
Any help with this appreciated
For example:
Code:
$var1 = 5;
$var2 = 5;
$var3 = 4;
$var4 = 2;
Any help with this appreciated

Last edited: