generate random number of 4 digit in php
<?php
$FourDigitRandomNumber = mt_rand(1111,9999);
echo $FourDigitRandomNumber;
?>
generate random number of 4 digit in php
<?php
$FourDigitRandomNumber = mt_rand(1111,9999);
echo $FourDigitRandomNumber;
?>
php randon integer 4 digit
$digits = 3;
echo rand(pow(10, $digits-1), pow(10, $digits)-1);
php random 5 digit number
$limit = 3;
echo random_int(10 ** ($limit - 1), (10 ** $limit) - 1);
Genrate Random Integer 10 digits in php
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;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us