User Login

Help Community Login:

PHP: Generate Random AlphaNumeric Password / ID

sharkar's picture
I use Google ChromeI use SafariWindows User
Relationship Status:
Single & Looking
Joined: 11/03/2012
Posts: 1
Drops: 23
Mood: Accomplished

Nice little PHP function that will generate a completely random password.

* The letter l (lowercase L) and the number 1 have been removed, as they can be mistaken for each other
function createRandomPassword() {
$chars = "abcdefghijkmnopqrstuvwxyz023456789";
$i = 0;
$pass = '' ;
while ($i <= 7) {
  $num = rand() % 33;
  $tmp = substr($chars, $num, 1);
  $pass = $pass . $tmp;
return $pass;
// Usage
$password = createRandomPassword();
echo "Your random password is: $password";
I Averaged: 2 | 1 vote

Read More ...

Who's New

Shop Bench 1's picture
jorge mendoza's picture
jinrek's picture
Gew's picture
pinot's picture
ritacastillo's picture
WiredWilly's picture
JoeBAR's picture
anthonys's picture
carota's picture
tina's picture
erixisverizon's picture
Marshen31's picture
bashir1464's picture
E0nW0lf's picture
facebook codes exploits tips tricks Phrozen Crew
All contents ©Copyright GeekDrop 2009-2018
TOS | Privacy Policy