PX : code

Password generator by Hamish Milne
Download this code


<?php
/*
randpass( parameters:
$length (8) : Total length of password.
)
Made by Hamish Milne
*/
function randpass($e=8){
    
$a=array(range('a','z'),range('A','Z'),range(0,9),array('!','','$','%','&','*','-','_','+','?','@','#','~'));
    
$l=$e-strlen($p);
    for(
$i=0;$i<$l;$i++,$y=array_rand($a),$r.=$a[$y][array_rand($a[$y])]);
    return 
$r;
}
//echo randpass(10);
?>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.