Re: Random

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux