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 = 辜寬敏批蘇貞昌:做縣長有餘 其他不用說 (2012-05-08)

  • 中華電信不開放最後一哩 這樣的電信業者怎麼會進步 (2020-05-26)
  • 全新Apple iPad 2代 64GB Wifi +3G版 只有NT$22,000 (2011-03-31)
  • joomla 測試~ (2009-03-03)
  • 終於在Ubuntu下安裝好VMware Workstation 7.1.6和客體 (2012-08-09)
  • 隨機美圖

    發佈留言

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