Create Random Number using php
by satheeshkumar[ Edit ] 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;
?>