xxxxxxxxxx
<?php
$sixDigitRandomNumber = mt_rand(111111,999999);
echo $sixDigitRandomNumber;
?>
xxxxxxxxxx
<?php
$FourDigitRandomNumber = mt_rand(1111,9999);
echo $FourDigitRandomNumber;
?>
xxxxxxxxxx
<?php
#The rand() function generates a random number:
echo(rand());
#Picks a random number from anywhere to anywhere
echo(rand(0, 10));
#Picks a random number from 0 to 10
<?
xxxxxxxxxx
$digits = 3;
echo rand(pow(10, $digits-1), pow(10, $digits)-1);