Born 6 ~ There are several 16-bit user names. The most important thing is text control. the condition for a colleague is to have a string package. It mainly contains three programs. Procedure 1: Extract data randomly from the dictionary and write it into a new file. (1.php )? Php/* Dictionary File
Born 6 ~ There are several 16-bit user names. The most important thing is text control. the condition for a colleague is to have a string package. It mainly contains three programs.
Procedure 1: Extract data randomly from the dictionary and write it into a new file. (1.php)
/* Extract random values from dictionary files */
$ File1 = './Words. dic ';
$ File2 = './common_pass_mini.dic ';
$ File3 = './Sys_Month_Date.Dic ';
$ Rfile = './5. dic ';
$ N = 2000;
// Extract the dictionary
$ Basef = file ($ file1 );
$ Extf = file ($ file2 );
$ Extf2 = file ($ file3 );
$ Bf_sum = (count ($ basef)-1 );
$ Ef_sum = (count ($ extf)-1 );
$ Ef2_sum = (count ($ extf2)-1 );
// Obtain the random user name
For ($ I = 0; $ I <$ n; $ I)
{
$ Bn = crand (0, $ bf_sum );
$ En = crand (0, $ ef_sum );
$ En2 = crand (0, $ ef2_sum );
$ Name = $ basef [$ bn]. '_'. $ extf [$ en];
$ Name = str_replace ('\ r \ n', '', $ name );
$ All_name [] = $ name;
}
// Write the file
$ Result = implode ('\ r \ n', $ all_name );
$ Fp = fopen ($ rfile, 'A') or die ('open $ rfile failed ');
If (fwrite ($ fp, $ result )){
Echo 'write user succeed! ';
} Else {
Echo 'write user failed ';
}
// Natural Random number function
Function crand ($ start, $ end)
{
Return mt_rand ($ start, $ end );
}
?>
Procedure 2: merge the results of several inherent documents above. (2.php)
/* Merge all natural results */
$ Result_file = './result. dic ';
$ Fp = fopen ($ result_file, 'A') or die ('open $ result_file failed ');
// Merge 1.dic ~ 5. dic
For ($ I = 1; $ I <= 5; $ I)
{
$ Cur_file = file_get_contents ($ I. '. dic ');
Fwrite ($ fp, $ cur_file );
}
// Merge 10.dic ~ 11. dic
For ($ I = 10; $ I <= 11; $ I)
{
$ Cur_file = file_get_contents ($ I. '. dic ');
Fwrite ($ fp, $ cur_file );
}
Fclose ($ fp );
Echo 'write succeed ';
?>
Procedure 3: filter duplicate values and do not belong to 6 ~ Between 16 values and the ultimate outcome (3.php)
/* Inherent ultimate outcome */
$ File = './result. dic ';
$ Target = './target. dic ';
// Remove duplicate values
$ Files = file ($ file );
$ Files = array_unique ($ files );
// Determine whether the value is greater than 6 bits and less than 16 bits
$ Sum = count ($ files );
For ($ I = 0; $ I <$ sum; $ I)
{
If (strlen ($ files [$ I])> = 6 & strlen ($ files [$ I]) <= 16 ){
$ Rs [] = $ files [$ I];
} Else {
Continue;
}
}
// Write it into the target file
$ Result = implode ('', $ rs );
$ Fp = fopen ($ target, 'A') or die ('open $ target failed ');
Fwrite ($ fp, $ result );
Echo 'write succeed ';
?>
The basic work is done manually, with random usernames created above. haha, make sure your application is sufficient.