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
You almost have it right. The problem was the unset($arr_history[$selected]); line. The value of $selected isn't a key but in fact a value so the unset wouldn't work.
unset($arr_history[$selected]);
$selected
To keep it the same as what you have up there:
Or an example with a few less lines: