Is there a way to generate a random number based on a min and max?
For example, if min was 1 and max 20 it should generate any number between 1 and 20, including 1 a
In a new PHP7 there is a finally a support for a cryptographically secure pseudo-random integers.
int random_int ( int $min , int $max )
random_int — Generates cryptographically secure pseudo-random integers
which basically makes previous answers obsolete.