This article has been dead for over three months
You
function passGen($length,$nums){
$lowLet = "abcdefghijklmnopqrstuvwxyz";
$highLet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$numbers = "123456789";
$pass = "";
$i = 1;
While ($i <= $length){
$type = rand(0,1);
if ($type == 0){
if (($length-$i+1) > $nums){
$type2 = rand(0,1);
if ($type2 == 0){
$ran = rand(0,25);
$pass .= $lowLet[$ran];
}else{
$ran = rand(0,25);
$pass .= $highLet[$ran];
}
}else{
$ran = rand(0,8);
$pass .= $numbers[$ran];
$nums--;
}
}else{
if ($nums > 0){
$ran = rand(0,8);
$pass .= $numbers[$ran];
$nums--;
}else{
$type2 = rand(0,1);
if ($type2 == 0){
$ran = rand(0,25);
$pass .= $lowLet[$ran];
}else{
$ran = rand(0,25);
$pass .= $highLet[$ran];
}
}
}
$i++;
}
return $pass;
}