I want to select a random value from a array, but keep it unique as long as possible.
For example if I\'m selecting a value 4 times from a array of 4 elements, the s
Php has a native function called shuffle which you could use to randomly order the elements in the array. So what about this?
shuffle
$arr = ('abc', 'def', 'xyz', 'qqq'); $random = shuffle($arr); foreach($random as $number) { echo $number; }