Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * The letter l (lowercase L) and the number 1
  5. * have been removed, as they can be mistaken
  6. * for each other.
  7. * Tito code :eyeswideshut25@hotmail.com
  8. */
  9.  
  10. function createRandomPassword() {
  11.  
  12. $chars = "abcdefghijkmnopqrstuvwxyz023456789";
  13. srand((double)microtime()*1000000);
  14. $i = 0;
  15. $pass = '' ;
  16.  
  17. while ($i <= 7) {
  18. $num = rand() % 33;
  19. $tmp = substr($chars, $num, 1);
  20. $pass = $pass . $tmp;
  21. $i++;
  22. }
  23.  
  24. return $pass;
  25.  
  26. }
  27.  
  28. // Usage
  29. //$password = createRandomPassword();
  30. //echo "Your random password is: $password";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement