here is my simple code to random numbers from 0 - 5:
PHP Code:
for( $i = 0; $i <= 5; $i++) { echo mt_rand(0, 5). ", "; }
after running it many times, i got brief result as follows:
1, 4, 4, 5, 0
4, 0, 1, 5, 0
3, 2, 1, 1, 3
..
& so on..
my question is, what is the script in order the result doesn't contain DUPLICATE numbers like above.
I like the result something like this:
1, 5, 0, 3, 2
4, 1, 2, 3, 0
...
|