What is the most effective way to create a PHP function that will pick a given amount of random number, but evenly spaced out and contain no duplicates?
For example say you wanted 3 random number between 0-6 the result could be [0, 2, 5] or [1, 3, 6].
Any ideas on how to get started?
Note that none of codes below will work directly as a copy paste.
If you want to select a random number, use
mt_rand(min, max).If you want to select a random number which is divisible by N, use
mt_rand(min, max)*N.If you want to select M random numbers which are all divisible by N, use a loop:
That is what I understand from your question.