{* *}
code teams

Generate Unique ID



Generate a unique alpha-numeric id. Pass in the length of the string you want returned.

function getUniqueCode($length = "")
{
    $code = md5(uniqid(rand(), true));
    if ($length != "") return substr($code, 0, $length);
        else return $code;
}