Tuesday 3 April 2012

PHP Generate unique id

//uid with md5 function
echo md5( uniqid() );

Sample output: 0021228154ffc7fdc49390e5f131a3f8

1 comment:

  1. Output from md5() is not unique!

    http://www.php.net/manual/en/function.uniqid.php#91126

    ReplyDelete