How Can I Generate a 10 Digits Random Number Using PHP?

Generate a 10 Digit Unique Number using PHP, Generate a 10 Digits Random Number using PHP, Get 10 Digits Random Number in PHP, Create 10 Digits Random Number Using PHP, 10 Digit Unique Number Generate in PHP

Hello Friends Today I will tell you through this Tutorial how you can generate the random number of Ten digits Using PHP Function.

mt_rand(0, 9); This is the inbuild function of a php, you can generate a random number of 10 digit through it.

So let us know how this function is used.

You create a file called a tendigitrandom.php and then copy and paste this php code into tendigitrandom.php file. Then after that you open it on the local server.

tendigitrandom.php

<?php 
function generateCode($limit){
$code = '';
for($i = 0; $i < $limit; $i++) { $code .= mt_rand(0, 9); }
return $code;
}
echo generateCode(10);
?>