好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

php生成随机六位数密码代码

<?php //随机产生六位数密码Begin function randStr($len=6,$format=’ALL’) { switch($format) { case ‘ALL’: $chars=’ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-@#~’; break; case ‘CHAR’: $chars=’ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-@#~’; break; case ‘NUMBER’: $chars=’0123456789′; break; default : $chars=’ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-@#~’; break; } mt_srand((double)microtime()*1000000*getmypid()); $password=]"; while(strlen($password)<$len) $password.=substr($chars,(mt_rand()%strlen($chars)),1); return $password; } //随机产生六位数密码End ?>

查看更多关于php生成随机六位数密码代码的详细内容...

  阅读:51次