开发者

Return variable with the highest value?

开发者 https://www.devze.com 2023-02-27 22:16 出处:网络
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)

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 sear开发者_如何转开发ches


$highest = max($num1, $num2, $num3);
0

精彩评论

暂无评论...
验证码 换一张
取 消