note 72912 deleted from function.rand by felipe
| From: | felipe@php.net | Date: | Sun, 30 Dec 2007 18:45:18 +0000 |
| Subject: | note 72912 deleted from function.rand by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134446@lists.php.net to get a copy of this message | ||
Note Submitter: tahir at sandikkaya dot name dot tr
----
A single line random string generator.
Since crypt() function generally generates a string of 32 characters that contains some
non-alphanumeric characters, my code does not guarantee the length of the random string, but
generally speaking, it is efficient up to 24 characters.
substr(preg_replace('/[\/\\\:*?"<>|.$^1]/', '', crypt(time())), 0,
16);