-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex5.php
67 lines (51 loc) · 1.48 KB
/
ex5.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<html>
<head>
<style>
div{
margin-top: 30px;
margin-left: 30px;
}
button {
margin: 10px 0 0 30px;
width: 120px;
height: 30px;
}
input {
width: 80px;
height: 25px;
margin-right: 15px;
margin-bottom: 5px;
}
</style>
</head>
<body>
<div>
<form action="" method="GET">
<h2>Enter 10 numbers: </h2>
<input type="number" step= 0.01 name="n0">
<input type="number" step= 0.01 name="n1"> <br>
<input type="number" step= 0.01 name="n2">
<input type="number" step= 0.01 name="n3"> <br>
<input type="number" step= 0.01 name="n4">
<input type="number" step= 0.01 name="n5"> <br>
<input type="number" step= 0.01 name="n6">
<input type="number" step= 0.01 name="n7"> <br>
<input type="number" step= 0.01 name="n8">
<input type="number" step= 0.01 name="n9"> <br>
<button type="submit">Sumbit</button>
</form>
</div>
</body>
</html>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'GET' && isset($_GET['n0'])) {
for ($i = 0; $i < 10; $i++){
$x = $_GET["n".$i];
$tab[$i] = $x;
}
echo "<br>";
print_r($tab);
echo "<br><br>The minimum is " . min($tab);
echo "<br><br>The maximum is " . max($tab);
}
?>