Location: PHP
Create a random password - PHP function
Simple code in PHP that created a random password
//a function that generates a random password
private function createRandomPassword()
{
$chars = "abcdefghijkmnopqrstuvwxyz023456789";
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
while ($i <= 7)
{
$num = rand() % 33;
$tmp = substr($chars, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}
Rate:
Be the first to Rank
Be the first to RankRelated content
27/03/2010
Rate:
Be the first to RankLocation: Cheat Sheets / PHP
|
||
27/03/2010
Rate:
Be the first to RankLocation: Cheat Sheets / PHP
|
||
|
Learn everything you need to know about PHP magic methods 20/07/2010
Rate:
|
|
|
A Boilerplate CakePHP Distribution For Web Apps 01/12/2010
Rate:
Be the first to RankEven with a rapid development framework like CakePHP, when creating a production site, there are tons..
|
|










