function yam($length){
$a="1234567890";
$b="qwertyuiopasdfghjklzxcvbnm";
$c="QWERTYUIOPASDFGHJKLZXCVBNM";
$d=$a.$b.$c;
for ($e=0;$e<$length;$e++){
//echo $d{mt_rand(1, strlen($d)-1)};
$f{$e}=$d{mt_rand(1, strlen($d)-1)};
}
return $f;
}
//yam(4);
$g=yam(4);
foreach ($g as $key=>$x){
echo $x;
}