You Are Here: Home »   Code Friday September 3rd 2010

Code Library - php

Random Password - (1483 views)


<?PHP

#remove l + 1 as they can be confused if mailing the pass

function CreatePass() {
    
$chars "abcdefghijkmnopqrstuvwxyz023456789@";
    
srand((double)microtime()*1000000);
    
$i 0;    $pass '' ;
    while (
$i <= 12) {
        
$num rand() % 33;
        
$tmp substr($chars$num1);
        
$pass $pass $tmp;
        
$i++;
}
return 
$pass;
}

?>