diff options
author | louie <lshprung@yahoo.com> | 2020-09-20 09:26:58 -0700 |
---|---|---|
committer | louie <lshprung@yahoo.com> | 2020-09-20 09:26:58 -0700 |
commit | a8c0d5619ee6d518737628d6c585233d0bba23da (patch) | |
tree | 30c13cf2439700c78d51acc9b430cb5fa092f963 /test.php |
First commit
Diffstat (limited to 'test.php')
-rw-r--r-- | test.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test.php b/test.php new file mode 100644 index 0000000..c1c7c22 --- /dev/null +++ b/test.php @@ -0,0 +1,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();
+
+?>
\ No newline at end of file |