<?php
function password ($length) {
$abc = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,0,1,2,3,4,5,6,7,8,9";
$abcarray = explode(",",$abc);
mt_srand((double)microtime()*1000000);
$thepassword = "";
for ($i=1;$i<=$length;$i++) {
$rand = mt_rand(0,35);
$thepassword .= $abcarray[$rand];
}
return $thepassword;
}
$pass = password(10); // call function with length
echo $pass;
?>