PHP 亂數密碼產生器

Sample 1:
function randStr($len=6)
{
$chars=’ABDEFGHJKLMNPQRSTVWXYabdefghijkmnpqrstvwxy23456789#%*’;
// characters to build the password from
mt_srand((double)microtime()*1000000*getmypid());
// seed the random number generater (must be done)
$password=”;
while(strlen($password)<$len)
$password.=substr($chars,(mt_rand()%strlen($chars)),1);
return $password;
}

Sample 2:
function generatorPassword()
{
$password_len = 7;
$password = ”;

// remove o,0,1,l
$word = Acer Aspire M3100 驅動 (2009-06-22)

  • facebook 開心農場外掛 (2009-10-03)
  • 為什麼汽油的價錢一直在掉 瓦斯的價錢都沒有掉 (2010-02-26)
  • 卡巴斯基CEO說 麥金塔的安全性落後微軟10年 (2012-04-26)
  • 數學是這樣算的嗎?好一個17P好康,團購都不用算數字嗎? (2012-10-30)
  • 隨機美圖

    發佈留言

    發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *