Sun Nov 30, 2008 8:12 pm
<?php
function generateRandpassword($size=9, $power=0) {
$vowels = 'aeuy';
$randconstant = 'bdghjmnpqrstvz';
if ($power & 1) {
$randconstant .= 'BDGHJLMNPQRSTVWXZ';
}
if ($power & 2) {
$vowels .= "AEUY";
}
if ($power & 4) {
$randconstant .= '23456789';
}
if ($power & 8) {
$randconstant .= '@#$%';
}
$Randpassword = '';
$alt = time() % 2;
for ($i = 0; $i < $size; $i++) {
if ($alt == 1) {
$Randpassword .= $randconstant[(rand() % strlen($randconstant))];
$alt = 0;
} else {
$Randpassword .= $vowels[(rand() % strlen($vowels))];
$alt = 1;
}
}
return $Randpassword;
}
?>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.