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 = BPR:手術刀還是消炎藥? (2007-11-03)

  • XaaS 相關蒐集 (2026-03-19)
  • 整合線上儲存的手機商 免費空間給你用 (2012-04-06)
  • Alexa終於還我公道了 (2012-01-17)
  • CPU-AMD稱OLPC百元筆記本最綠色 閒置能耗僅1瓦 (2007-11-03)
  • 隨機美圖

    發佈留言

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