PHP生成唯一uuid 序列码
/*
* uuid 唯一序列码
*/
function uuid($prefix = '')
{
$chars = md5(uniqid(mt_rand(), true));
$uuid = substr($chars,0,8) . '-';
$uuid .= substr($chars,8,4) . '-';
$uuid .= substr($chars,12,4) . '-';
$uuid .= substr($chars,16,4) . '-';
$uuid .= substr($chars,20,12);
return $prefix . $uuid;
}
博客主要介绍了使用PHP生成唯一uuid序列码的相关内容,聚焦于信息技术领域中PHP开发的这一小技巧。
577

被折叠的 条评论
为什么被折叠?



