skip to Main Content

php pseudo-random distribution in a loop

I have some code that generates a random output based on prior parameters from different arrays Data setup: $persons = array("Old", "Young", "Child"); $moods = array("neutral", "happy", "sad"); $newarray= ""; shuffle($persons ); $persons2 = array_merge(...array_fill(1, 92, $persons )); $persons2 =…

VIEW QUESTION

PHP Complex Number Selection

I have wrote the following code: $row_array = range( 1 , $puzzle_size , 1 ); $yes_array = array_rand( $row_array , $total_numbers_to_display ); The values of $puzzle_size and $total_numbers_to_display depends on the difficulty level: $puzzle_size will be 8, 20 and 40…

VIEW QUESTION

Random data from json file

I create a quiz using json files as categories. I would like to have random categories and random questions. I managed to have random categories already but still can't figure out how to create drawing questions from json file. I…

VIEW QUESTION
Back To Top
Search