Php scipt which generate 1000 unique 16 digit no.

3 views
Skip to first unread message

zeesh...@gmail.com

unread,
Jul 15, 2005, 5:26:20 AM7/15/05
to php...@googlegroups.com
<?php
set_time_limit(0);
// Application for generating 1000 unique 16 digit no.

foreach(range(1,1000) as $tt){
foreach(range(1,16) as $t){
$string = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
$no = rand(1, 35);
$card[] = substr($string, $no, 1);
}

$cardno[] = trim(implode("",$card));
unset($card);
}
$result = array_unique($cardno);
$f = fopen("data.txt","w");

foreach($result as $k=> $v ) {
$data = "$v\r\n";
fwrite($f,$data);
}
fclose($f);
echo "Data.txt is created with 1000 unique 16 digit no <br>";
?>

Reply all
Reply to author
Forward
0 new messages