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 = 管路阻塞,沒有管路,怎麼會是同一件事? (2014-06-09)

  • mysql replace取代字串指令這樣用 (2013-05-28)
  • 擊敗華碩 宏碁重登台灣NB龍頭 (2007-11-09)
  • 網樂通&Sony Bravia 32吋液晶電視再測 (2011-01-22)
  • 一個 SQL Injection 考倒的面試者 與看圖說故事的面試者 (2013-10-11)
  • 隨機美圖

    發佈留言

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