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 = 安全的PHP程式 (2011-09-09)

  • 開箱測試 APC Back-UPS Pro 1000 (BR1000G-TW) 1000VA UPS (2014-10-27)
  • 2003年7大潛力Killer Apps<---又不一個不準的東西 (2007-11-12)
  • 利用 VMware 優化工具 虛擬機優化實驗 (2021-10-29)
  • facebook帳號驗證問題 (2011-08-13)
  • 隨機美圖

    發佈留言

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