note 23107 modified in function.md5 by victor

From: Date: Sat, 24 Aug 2002 08:13:02 +0000
Subject: note 23107 modified in function.md5 by victor
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-35447@lists.php.net to get a copy of this message
[Editor: If you don't want to reinvent the wheel, take a look at uniqid()] This code will always generate an unique string... function unique() { $temp = explode(" ",microtime()); $temp = $temp[0].$temp[1]; settype($temp,'int'); $temp+=time(); return md5($temp); } --was-- This code will always generate an unique string... function unique() { $temp = explode(" ",microtime()); $temp = $temp[0].$temp[1]; settype($temp,'int'); $temp+=time(); return md5($temp); } http://www.php.net/manual/en/function.md5.php

« previous php.notes (#35447) next »