forked from kokonior/PHP-Projects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAlvin.php
63 lines (50 loc) · 1.01 KB
/
Alvin.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
<?php
require_once "templates/header.php";
if (! playersRegistered()) {
header("location: index.php");
}
if ($_POST['cell']) {
$win = play($_POST['cell']);
if ($win) {
header("location: result.php?player=" . getTurn());
}
}
if (playsCount() >= 9) {
header("location: result.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Exanthenon</title>
<style>
.kotak {
width: 50px;
height: 50px;
background-color: salmon;
text-align: center;
line-height: 50px;
margin: 3px;
float: left;
}
.clear { clear: both; }
</style>
</head>
<body>
<?php for( $i = 0; $i < count($angka); $i++ ) { ?>
<div class="kotak"><?php echo $angka[$i]; ?></div>
<?php } ?>
<div class="clear"></div>
<?php foreach ($angka as $a) { ?>
<div class="kotak"><?php echo $a; ?></div>
<?php } ?>
<div class="clear"></div>
<?php foreach ( $angka as $a ) : ?>
<div class="kotak"><?= $a; ?></div>
<?php endforeach ?>
</body>
</html>
<?php
$angka = [3,2,15,20,11,77,89,8,7];
?>