garfield

[PHP] Generate Random Password

Nov 5th, 2011
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.94 KB | None | 0 0
  1. /*================================================================
  2.          _ ____ _____ __ __
  3.         (_) _ \ ___ | _ _ | _ __ __ | \ / |
  4.         | | | _) / __ | | | / _ \ / _ `| | \ / | |
  5.         | | __ / \ __ \ | | __ / (_ | | | | |
  6.         |_|_| |___/ | _ | \ ___ | \ __,_|_| | _ |
  7.  
  8.             Criado por SuYaNw Dácio
  9.             www.ips-team.blogspot.com
  10.              Generate Random Password
  11.  
  12. ===============================================================*/
  13.  
  14. function GenerateRandomPassword($size) // By: [iPs]SuYaNw
  15. {
  16.     $sStr   = NULL;
  17.     $Words  = Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R",
  18.                     "S","T","U","V","W","X","Y","1","2","3","4","5","6","7","8","9","0",
  19.                     "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r",
  20.                     "s","t","u","v","w","x","y","Z","z" )
  21.                     ;
  22.     for($i = 0; $i != $size; ++$i)
  23.     {
  24.         $sStr .= $Words[array_rand($Words)];
  25.     }
  26.     return $sStr;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment