I use something like...

function randString($sequence_length = 7)
  $possible_letters = "abcdefghijklmnopqrstuvwxzy";
  $sequence = ""

  while ($sequence_length--) {
    $sequence .= $possible_letters[rand(0, strlen($possible_letters) - 1)];
  }

  return $sequence;
}

To create random strings. Just fill in $possible_letters with anything you
like

adamw


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 09, 2001 3:12 PM
Subject: [PHP] Generate Random Letters?


> I know it is possible to generate a random number using rand() I don`t
> suppose there is anyway to generate a random letter sequence that anyone
> knows of?
>
> Ade
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to