I need to select the largest value between two variables, but not return the value itself. So using max
won't do the trick.
Example:
$value1 = 60;
$value2 = 24;
I need $value1
(the variable name) to be returned. This would be simpler to do, were the variables in an array as I could do a foreach
loop to return the key with the highest value, but I don't think there's much point creating an array when there's only every going to be two values, unless it won't effect the efficiency at all (I'm not sure it will).