
Jasmine
Administrator
/ Moderator
Apr 6, 2000, 3:51 PM
Post #2 of 11
(910 views)
|
|
Re: How to generate a word with 8 random characters?
[In reply to]
|
Can't Post
|
|
I'm certain there are other ways to do this, but here's what I'm thinking of right now )... First, build a list of valid characters to be included, then create a loop that loops through the number of characters you want to have, appending one random character at a time. <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> @chars=("A".."Z","a".."z","0".."9"); for ($i=1; $i<=8;$i++){ $random .= $salt[rand @chars]; } </pre><HR></BLOCKQUOTE>
|