Return variable with the highest value?

若如初见. 提交于 2019-12-19 21:55:34

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/5737305/return-variable-with-the-highest-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!