<?php function draw_rand_array($array,$draws) { $lastIndex = count($array) - 1; $returnArr = array(); while($draws > 1) { $rndIndex = rand(0,$lastIndex); array_push($returnArr,array_splice($array,$rndIndex,1)); $draws--; $lastIndex--; } return $returnArr; } ?>