I want to generate a 6 digit random number using the PHP mt_rand()
function.
I know the PHP mt_rand()
function only takes 2 parameters: a minimum and a maximum value.
How can I do that?
I want to generate a 6 digit random number using the PHP mt_rand()
function.
I know the PHP mt_rand()
function only takes 2 parameters: a minimum and a maximum value.
How can I do that?
as far as understood, it should be like that;
Examples:
More Details
Here mt_rand(min,max);
min = Specifies the lowest number to be returned.
max = Specifies the highest number to be returned.
`
Something like this ?
Or this, then the first digit can be 0 in first example can it only be 1 to 9
You can do it inline like this:
Or the simpliar way, with a function:
These will produce an array like this:
If the first member nunmber can be zero, then you need format it to fill it with zeroes, if necessary.
Or, if it can be form zero, you can do that, to: