php uuid

  function uuid($prefix = '')

  {

    $chars = md5(uniqid(mt_rand(), true));

    $uuid  = substr($chars,0,8) . '-';

    $uuid .= substr($chars,8,4) . '-';

    $uuid .= substr($chars,12,4) . '-';

    $uuid .= substr($chars,16,4) . '-';

    $uuid .= substr($chars,20,12);

    return $prefix . $uuid;

  }



links
http://blog.longwin.com.tw/2008/09/uuid-generator-function-php-javascript-ruby-2008/
http://www.ajaxray.com/blog/2008/02/06/php-uuid-generator-function/ http://www.soulhuntre.com/2004/10/29/uuid-guid-in-native-php/

你可能感兴趣的:(uuid)