Re: rand_str
| From: | Daniel Andersson | Date: | Sun, 05 Aug 2001 02:28:24 +0000 |
| Subject: | Re: rand_str | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-62116@lists.php.net to get a copy of this message | ||
sounds useful and cool, me thinks :o)
/ d
<jeroen@php.net> wrote in message
news:20010804205438.88378.qmail@pb1.pair.com...
> Hi,
>
> I'm thinking about a new function: [mt_]rand_str
>
> Syntax:
> string [mt_]rand_str(minlen,maxlen[,charlist]);
>
> where charlist is in addcslashes (and now also [l|r]trim) syntax.
> Charlist defaults to 0..9a..zA..Z
>
>
> IMHO, this would be a very useful function.
>
> Any comments? Maybe not min&maxlen, but simply a fixed len? (since
> randomness on the length is ambigious to implement, there are less
> possibilities with shorter strings, which raises some issues).
>
> As an extension, the function could also accept an array as charlist,
> containing small strings, to produce pronouncable strings.
>
> Jeroen
>
>
>
>