PHP使用字符串ID

浏览:531 发布日期:2018/12/29 分类:功能实现 关键字: 字符串id
PHP使用字符串ID
阿里云搞活动,想要抓紧买:https://promotion.aliyun.com/ntms/act/qwbk.html?userCode=4hy76kwx

我们看有的系统,经常会看到很长的字符串ID,在PHP中找了很久没有找到这样的功能,但是,我发现mysql中有这样的函数,所以,在PHP中应用的话,我们可以用mysql获取字符串ID,代码如下://获取uuid
function getuuid(){
    $arr = db('table')->field('uuid() as uuid')->find();
    //在mysql中获取的uuid,默认是带有中横线‘-’的,直接去掉
    return str_replace('-','',$arr['uuid']);
}
阿里云搞活动,想要抓紧买:https://promotion.aliyun.com/ntms/act/qwbk.html?userCode=4hy76kwx
评论( 相关
后面还有条评论,点击查看>>