开发者

Php least number

can any one help me about how to find the least number of five inputs like 1,2,3,4,5 where the least is 1...

and find the 2nd least number where it is 2 then 3rd least number where it is 3 and 4th least numb where it is 4 and the largest number where it is 5..

<input type ="text" name ="num1">
<input type =开发者_运维知识库"text" name ="num2">
<input type ="text" name ="num3">
<input type ="text" name ="num4">

<input type ="text" name ="answer">


You would sort() the numbers and then echo them back into the value attribute of your answer element.


$values = array($_POST["num1"],$_POST["num2"],$_POST["num3"],$_POST["num4"]);
sort($values);
var_dump($values);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜