RFC: rand_str

From: Date: Sat, 04 Aug 2001 19:37:53 +0000
Subject: RFC: rand_str
Groups: php.dev 
Request: Send a blank email to php-dev+get-62082@lists.php.net to get a copy of this message
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

« previous php.dev (#62082) next »