summaryrefslogtreecommitdiff
path: root/test.php
blob: c1c7c2200e02e8d81aead41e2070d9d7f039bfb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
    //////////GLOBAL VARIABLES/
    global $dice_arr;
    $dice_arr = [];
    for($i=1; $i<=6; $i++){
        array_push($dice_arr, $i . ".png");
    }
    ///////////////////////////
    function dice_rand(){
        $dice_arr = $GLOBALS['dice_arr'];
        $e = random_int(0, 5);
        return $dice_arr[$e];
    }

    print dice_rand();

?>