The return variable with the highest value?

I have 3 variables: $ num1, $ num2 and $ num3. Each of them represents the number of rows that a table column has.

I want to find which variable has the highest variable, so I can use it in a for loop (shown below)

 for ( $row = 1; $row <= $HIGHEST_VARIABLE; $row++) { ... } 

It may have already been answered, but I can not find it based on my searches

+4
source share
1 answer
 $highest = max($num1, $num2, $num3); 
+7
source

All Articles