PHP生成GUID算法

/**
 * 创建GUID
 *
 * @return string
 */
function get_guid(){
    $tmp = md5(uniqid(md5(microtime(true)),true));
    $units = substr($tmp,0,8) . '-' . substr($tmp,8,4) . '-' . substr($tmp,12,4) . '-' . substr($tmp,16,4) . '-' . substr($tmp,20,12);
    return $units;
}

4 Comments

  • 跨境电商导航

    2018-12-13

    好久没来了,过来转转

  • houang

    2018-12-03

    tets

  • houang

    2018-12-03

    test000

  • houang

    2018-12-03

    test

发表评论