Re: Random

From: Date: Mon, 24 Jan 2005 14:41:09 +0000
Subject: Re: Random
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-25438@lists.php.net to get a copy of this message
SargeTron wrote:
"How can I create a random string" rand() only returns an int (number), but I would like something like dd75$6*, you know, containing any character. I would like it only to do a certain string ONCE, so there are no duplicates (in a for loop). Hopefully I won't need to do a huge array. Any suggestions?
I would suggest uniqid() http://www.php.net/manual/en/function.uniqid.php It creates a random string that is 32 characters long, hopefully this will fit your needs? -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://www.php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

« previous php.windows (#25438) next »