Create Random Number using php

by satheeshkumar 2012-07-11 18:56:23

Create Random Number by using following php code,


function randomNumber(){
$length=4;
$number = '123456789';
$rand_number = '';
for ($i = 0; $i < $length; $i++)
{
$rand_number .= $number[(rand() % strlen($number))];
}
return $rand_number;
}
$randomnumber = randomNumber();
echo $randomnumber;
?>
862
like
0
dislike
0
mail
flag

You must LOGIN to add comments