【精简实用系列】百度经验文章生成唯一ID方法
如百度经验url:https://jingyan.baidu.com/article/afd8f4de82cbeb34e286e9b8.html
对应唯一uuid:afd8f4de82cbeb34e286e9b8
方法代码如下
//生成唯一的ID
function uuid() {
$charid = strtolower(md5(uniqid(rand(), true)));
return substr($charid,0,24);
}
如百度经验url:https://jingyan.baidu.com/article/afd8f4de82cbeb34e286e9b8.html
对应唯一uuid:afd8f4de82cbeb34e286e9b8
方法代码如下
//生成唯一的ID
function uuid() {
$charid = strtolower(md5(uniqid(rand(), true)));
return substr($charid,0,24);
}