Return to Snippet

Revision: 39036
at January 12, 2011 12:19 by nsbucky


Initial Code
function generatePassword($length=8)
{
$chars = array_merge(range(0,9),
                     range('a','z'),
                     range('A','Z'),
                     array('!','@','$','%','^','&','*'));		shuffle($chars);
$password = '';
for($i=0; $i<8; $i++) {
    $password .= $chars[$i];
}
return $password;
}

Initial URL

                                

Initial Description
Function to simply generate a random password.

Initial Title
PHP Password Generator

Initial Tags
php

Initial Language
PHP