Last active
September 23, 2020 11:00
-
-
Save hdogan/6416036 to your computer and use it in GitHub Desktop.
Linux Yaz Kampı 2013 - PHP ile Yazılım Geliştirme Kursu Çekiliş Kodu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="tr"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Çekiliş</title> | |
<style> | |
body { | |
font-family: Tahoma, sans-serif; | |
font-size: 40px; | |
} | |
</style> | |
</head> | |
<body> | |
<?php | |
/* | |
* Katilimci listesini dizi olarak giriyoruz (sadece anketi dolduranlar) | |
*/ | |
$katilimcilar = array( | |
'Hidayet Doğan', | |
'Engin Aygen', | |
'Engür Pişirici', | |
'Ramazan Terzi', | |
'Adil İlhan' | |
); | |
/* | |
* random.org API'sini kullanarak 0'dan baslayip $katilimcilar eleman sayisindan 1 eksik | |
* aralikta rasgele sayi getiriyoruz. | |
*/ | |
$balik = file_get_contents('http://www.random.org/integers/?num=1&min=0&max=' . (count($katilimcilar) - 1) . '&col=1&base=10&format=plain&rnd=new'); | |
echo '<p>Kazanan: <strong>' . $katilimcilar[(int) $balik] . '</strong></p>'; | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment