Last active
January 23, 2021 12:26
-
-
Save jimmyleeking/7ae3afee697adbca3ec6f4456d14c833 to your computer and use it in GitHub Desktop.
php随机数
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function uuid() | |
{ | |
$chars = md5(uniqid(mt_rand(), true)); | |
$uuid = substr ( $chars, 0, 8 ) . '-' | |
. substr ( $chars, 8, 4 ) . '-' | |
. substr ( $chars, 12, 4 ) . '-' | |
. substr ( $chars, 16, 4 ) . '-' | |
. substr ( $chars, 20, 12 ); | |
return $uuid ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment