-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloop.php
More file actions
40 lines (33 loc) · 705 Bytes
/
loop.php
File metadata and controls
40 lines (33 loc) · 705 Bytes
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
<?php
include "./oop-simple.php";
?>
<html>
<body>
<table style="border: 1px solid black;">
<tr>
<th>List Team Tournament Mobile Legend Lain Hati</th>
</tr>
<?php
// setting nilai total loop
$total = 100;
for($i=0; $i<$total; $i++){
// eksekusi perintah di bawah ini sebanyak $total
$nomor = $i + 1;
if(0 === $nomor % 10){
$color = "yellow";
}elseif(0 === $nomor % 2){
$color = "gray";
}else{
$color = "white";
}
echo "<tr style='background-color:{$color}'>\n";
echo "<td>{$nomor}</td>\n";
echo "</tr>\n";
}
$user = new User();
$user->setUsername("Toni OK");
echo $user->getUsername()."<br/>";
?>
</table>
</body>
</html>