2013/11/10

PHP 產生MD5編碼的亂數

亂數產生一組五個字元的字串

substr(md5(uniqid(rand(),true)),0,5)


PHP函數:
rand() 產生亂數
uniqid() 產生不重複序號
md5($str) 將$str以MD5編碼
substr($str,起始位置,字串長度) 擷取字串


沒有留言:

張貼留言