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 = 講到微軟的序號 唉~ 官字兩個口 (2021-08-20)

  • XenServer 線上備份 online backup (2016-08-14)
  • HTPC & Car PC 狂想 (2009-11-20)
  • 陪同廠商施工很難嗎? (2016-10-12)
  • 在Virtual Box中測試Lubuntu 1404.1 無法調整解析度的問題解法 (2014-10-21)
  • 隨機美圖

    發佈留言

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