Human readable password function

Try the human readable password generator online

<?php
/**
 * Creates human readable passwords
 * TODO: filter not desired phrases
 * @param unknown_type $length
 * @return unknown
 */

function com_dir_create_password($length = 10){
    global
$strength;

   
$conso = array("b","c","d","f","g","h","j","k","m","n","p","r","s","t","v","w","x","y","z");
   
$numeric = array(2,3,4,5,6,7,8,9);
   
$vocal = array("a","e","i","o","u");
   
$password = "";
   
srand ((double)microtime()*1000000);
   
   
$templength = ($length % 2) ? $length -1 : $length -2;
   
$max = $templength/2;

    for(
$i=1; $i<=$max; $i++)
    {
       
$password.=$conso[rand(0,19)];
       
$password.=$vocal[rand(0,4)];
    }

   
$len = strlen($password);
   
$halv = $len/2;
   
$p1 = substr($password, 0, $halv);
   
$p2 = substr($password, $halv, ($len - $halv));
   
$p3 = $numeric[rand(0,7)]. (($length % 2) ? '' : $numeric[rand(0,7)]);
   
   
$strength = 4.7*$len + 2*3.32;

   
$newpass = $password;
   
    return
$p1.$p3.$p2;
}
?>
Knowledge keywords: