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
Back To Top
Search