Posted by Tyxod on 11/18/21 11:42
The "shuffle" thing does the work but produces an array with 58
elements. And it works a lot faster than the recursive thing (it
matters if the function is used more than a few times in a script).
But if you need just 13 (or anything else <>58) items in the array the
recursive function is really the only sane way to go.
(of course one could "shuffle($randomstuff);" and then pick up the
first 13 items from the resulted array, but I really dont like doing
that)
Navigation:
[Reply to this message]
|