<?php
$FourDigitRandomNumber = mt_rand(1111,9999);
echo $FourDigitRandomNumber;
?>
<?php
$sixDigitRandomNumber = mt_rand(111111,999999);
echo $sixDigitRandomNumber;
?>
$limit = 3;
echo random_int(10 ** ($limit - 1), (10 ** $limit) - 1);
$digits = 3;
echo rand(pow(10, $digits-1), pow(10, $digits)-1);
$six_digit_random_number = random_int(100000, 999999)l
<?php
$FourDigitRandomNumber = mt_rand(1111,9999);
echo $FourDigitRandomNumber;
?>
function genrateRandomInteger($len = 10)
{
$last =-1; $code = '';
for ($i=0;$i<$len;$i++)
{
do {
$next_digit=mt_rand(0,9);
}
while ($next_digit == $last);
$last=$next_digit;
$code.=$next_digit;
}
return $code;
}
Code Example |
---|
Php :: |
Php :: laravel app running in console |
:: german locale php |
Php :: send json reponse php |
Php :: storepublicly laravel |
Php :: compact example in php |
:: |
Php :: joomla get group id |
:: |
:: php include external directory path |
Php :: |
:: import faker in laravel |
:: |
:: |
Php :: parse json nested array form url in php |
Php :: |
Php :: db seed in controller |
:: |
:: Invalid argument supplied for foreach() in C |
:: |
:: |
Php :: |
Php :: |
:: |
:: |
:: php slice array by key |
Php :: |
Php :: |
Php :: |
Php :: return json in php |