function Create_Field($num = 4) { global $gekozenkleuren, $COLORS; for ($i = 0; $i < $num; $i++) { Go_Random(count($COLORS)); } $_SESSION['mm_veld'] = $gekozenkleuren; }
function Go_Random($max) { global $used_randoms; $id = rand(1, $max); if (isset($used_randoms) && is_array($used_randoms) && in_array($id, $used_randoms)) { Go_Random($max); } else { $used_randoms[] = $id; return $id; } }