I have to generate 16 digit random number something like recharg card pin number.(including 0 at starting place) This is my code
function gen_num($len) {
$rand = '';
while(!(isset($rand[$len-1]))){
$rand .= mt_rand(0,9);
}
return substr( $rand , 0 , $len );
}
It works fine but takes time to generate.if i want to generate 1000 pin at a same time like
foreach($i=0;$i<=1000;$i++){
get_num(16)
}
It takes more time.What is the best way to generate this kind of pin?
';` – RN Kushwaha Dec 01 '15 at 05:55