函數randstr($len=6){ $chars='abcdefghijklmnopqrstuvwxyz0123456789'; #用於建構密碼的字元 #seed 隨機數產生器(必須完成) $password=''; while(strlen($password) $password.($chars,(mtmtm()%) 返回1( $密碼; } $salt = randstr();