4

I have 3 variables: $num1, $num2, and $num3. Each represent the number of rows 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++) {
     ...
}

This probably was already answered, but I can't find it based on my searches

sman591
  • 540
  • 6
  • 19

1 Answers1

7
$highest = max($num1, $num2, $num3);
zerkms
  • 249,484
  • 69
  • 436
  • 539