Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ez ok:
- function PasswdGen($lenth) {
- // makes a random alpha numeric string of a given lenth
- $aZ09 = array_merge(range('A', 'Z'), range('a', 'z'),range(0, 9));
- $out ='';
- for($c=0;$c < $lenth;$c++) {
- $out .= $aZ09[mt_rand(0,count($aZ09)-1)];
- }
- return $out;
- }
- Ez Több helyen is X@rul működik:
- function PasswdGen_2($chcount){
- $totalChar = $chcount;
- $salt = "1234567890qwertzuiopasdfghjklyxcvbnmQWERTZUIOPASDFGHJKLYXCVBNM";
- srand((double)microtime()*1000000);
- $user_passwd="";
- for($i=0;$i<$totalChar;$i++){
- $user_passwd=$user_passwd . substr($salt,rand()%strlen($salt),1);
- }
- return $user_passwd;
- }
Add Comment
Please, Sign In to add comment