note 60515 deleted from function.microtime by tularis

From: Date: Sun, 22 Jun 2008 12:12:12 +0000
Subject: note 60515 deleted from function.microtime by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-140692@lists.php.net to get a copy of this message
Note Submitter: junk at plaino dot com ---- Here's a quick function to output a unique number. Good for MySQL / SQL idexes and unique id values. function uniqueTimeStamp_float(){ $Asec = explode(" ", microtime()); $Amicro = explode(".", $Asec[0]); return ($Asec[1].".".substr($Amicro[1], 0, 4)); } print (uniqueTimeStamp_float()); // outputs a unique something like: // 1136849268.0180 function uniqueTimeStamp(){ $Asec = explode(" ", microtime()); $Amicro = explode(".", $Asec[0]); return ($Asec[1].substr($Amicro[1], 0, 4)); } print (uniqueTimeStamp()); // outputs a unique something like: // 11368492680180

« previous php.notes (#140692) next »