How to set the probability of numbers at random?

Code looks like this:
$one = rand(1, 6);
 $two = rand(1, 6);
 $three = rand(1, 6);


What I want to do? Want to make the probability of getting three identical numbers.
That is ($one == $two && $one == $three) will be possible with a probability of, for example, 80%
June 3rd 19 at 20:20
1 answer
June 3rd 19 at 20:22
Solution
Forehead:
$one = rand(1, 6);
if (rand(1, 10) <= 8 ) {
 $two = $three = $one;
} else {
 $two = rand(1, 6);
 $three = rand(1, 6);
}


rand() - gives a bad Rand, not use.
mt_rand () is better.
random_int() - gives a good random, but slower.

Find more questions by tags PHP