<?
function rand_pass($numchar){
$string = str_shuffle ("abcdefghijklmnopqrstuvwxyz1234567890");
$password = substr ($string, 1, $numchar);
return ($password);
}
//example
echo rand_pass('8'); // will return an 8 character long random password of numbers and letters like c8k4ss42
?>