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;
}
Last modification:March 13th, 2018 at 01:31 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment