Return to Snippet

Revision: 1076
at September 7, 2006 09:11 by javierarce


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

Revision: 1075
at September 7, 2006 09:10 by javierarce


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

Initial URL

                                

Initial Description
Generates a random string of variable length.

Initial Title
Generate Random String

Initial Tags
textmate

Initial Language
PHP