-
Notifications
You must be signed in to change notification settings - Fork 0
/
killer.php
60 lines (48 loc) · 1.18 KB
/
killer.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
<?php
require_once "include_db_moerder.php";
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mord am Pfarrerteich</title>
</head>
<body>
<main>
<?php
$userID=7;
$array = [2,7,1,3,9];
$anzahl=count($array);
$indexnext=0;
foreach($array as $el){
$indexnext++;
if($indexnext==$anzahl){
$indexnext=0;
break;
}
if($userID==$el){
break;
}
}
//########################################
$userID = 20;
$array = [2,7,1,3,9];
echo findTarget($userID, $array);
function findTarget($userID, $hitList){
array_push($hitList, $hitList[0]);
for ($i = 0; $i < count($hitList); $i++)
{
if ($hitList[$i] == $userID){
return $hitList[$i+1];
}
}
echo "userID not found!!"
}
?>
<br>
<br>
<br>
</main>
</body>
</html>