SV: [PHP-WIN] Random

From: Date: Mon, 24 Jan 2005 09:50:08 +0000
Subject: SV: [PHP-WIN] Random
Groups: php.windows 
Request: Send a blank email to php-windows+get-25435@lists.php.net to get a copy of this message
Hi, First take a look at the notes to rand() in the manual, there are several examples on how to generate random strings. To awoid duplications you could just put the used ones in an array and check every new one with in_array(). Alternativly, if you dont want to use arrays you could write a non repeating hash function and use microtime as the call value. Hth Henrik Hornemann -----Oprindelig meddelelse----- Fra: SargeTron [mailto:sargetron@knd.org.uk] Sendt: 19. januar 2005 18:10 Til: php-windows@lists.php.net Emne: [PHP-WIN] Random "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? -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.windows (#25435) next »