//  生成UUID,并去掉分割符
function guid() {
if (function_exists('com_create_guid')){
$uuid = com_create_guid();
}else{
mt_srand((double)microtime()*);//optional for php 4.2.0 and up.
$charid = strtoupper(md5(uniqid(rand(), true)));
$hyphen = chr();// "-"
$uuid = chr()// "{"
.substr($charid, , ).$hyphen
.substr($charid, , ).$hyphen
.substr($charid,, ).$hyphen
.substr($charid,, ).$hyphen
.substr($charid,,)
.chr();// "}"
}
$uuid = str_replace(array('-', '{', '}'), '', $uuid);
return $uuid;
}

PHP生成 uuid的更多相关文章

  1. Java 生成 UUID

    1.UUID 简介 UUID含义是通用唯一识别码 (Universally Unique Identifier),这是一个软件建构的标准,也是被开源软件基金会 (Open Software Found ...

  2. php生成UUID

    UUID含义是 通用唯一识别码 (Universally Unique Identifier),这 是一个软件建构的标准,也是被开源软件基金会 (Open Software Foundation, O ...

  3. JS生成UUID的方法实例

    <!DOCTYPE html> <html> <head> <script src="http://libs.baidu.com/jquery/1. ...

  4. linux c 生成uuid

    /********方法一**********/#include <stdio.h> #include <stdlib.h> #include <string.h> ...

  5. java 生成UUID

    UUID(Universally Unique Identifier)全局唯一标识符,是一个128位长的数字,一般用16进制表示. 算法的核心思想是结合机器的网卡.当地时间.一个随即数来生成UUID, ...

  6. Oracle数据库生成UUID

    从Data Ghost的blog得知,原来可以用Oracle来生成UUID,做法很简单,如下: select sys_guid() from dual;  数据类型是 raw(16) 有32个字符.

  7. java生成UUID通用唯一识别码 (Universally Unique Identifier)

    转自:http://blog.csdn.net/carefree31441/article/details/3998553 UUID含义是通用唯一识别码 (Universally Unique Ide ...

  8. (转)java生成UUID通用唯一识别码 (Universally Unique Identifier)

    (原文链接:http://blog.csdn.net/carefree31441/article/details/3998553)   UUID含义是通用唯一识别码 (Universally Uniq ...

  9. js 生成 UUID

    在项目中遇到要生成 UUID 的需求,第一反应就是有没有原生的生成方法,找了找,发现没有,只能自己建立算法 function. 下面是我用的算法 function uuid(len, radix) { ...

随机推荐

  1. ios微信支付 v3

    V2版本和V3版本存在很大的差异. 1. 从成功通过微信支付商户的资料审核返回的邮件开始: 你可以获得这些参数  appid,appSecret,partnerID,    partnerKey(从平 ...

  2. ngRoute路径出现#!#解决方案

    在做一个开源项目的时候,使用了"angular-route": "^1.6.4",发现设置了<a>标签的href后,点击后路径出现的不是#/,而是# ...

  3. C++头文件的处理

    C++的头文件比自己想的要复杂,不是简单地添加自己需要的头文件,这当中有一定的规律.简单归于以下几点: 1.非stadfx.h的头文件必须要有#pragma once的编译提示符,具体原因也不明白. ...

  4. shell 组合新的变量名

    shell 组合新的变量名 普通变量 name=yushuang var=name # 要获取到yushuang res=`eval echo '$'"$var"` echo $r ...

  5. Problem Q

    Problem Description A factory produces products packed in square packets of the same height h and of ...

  6. .Net Core在Ubuntu上操作MySql折腾实录

    .Net Core 2.0 发布也这么久了,一直想着折腾着玩玩,无奈一直没时间,这几天准备开始好好学习下C#在跨平台方面的应用,记录下来以备自己以后回忆.学习. 本篇博客的主要内容: MySql在Ub ...

  7. header操作cookie

    root@kl20080094:~# curl -I "http://www.xxx.com" HTTP/1.1 200 OK Server: nginx/0.8.53 Date: ...

  8. ⒂bootstrap组件 折叠 基础案例

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. HTML DOM应用案例2

    <html> <head> <title>day03</title> <script type="text/javascript&quo ...

  10. day3--深入学习命令总结

    1.查看命令帮助的几种方法 a.[命令] --help   适用于一般命令,非内置命令 b.man  [命令]     适用于一般命令,非内置命令 c.help  [命令]     适用于内置命令 d ...