Re: [PHP] generate random ascii string

2001-09-01 Thread bill
Philip, With a few tweaks, it works great, thanks! Here's what worked: function randomString($len) { global $seed; $tmp = ''; $chars = 'abcdefghijklmnopqrstuvwxyz'; $chars .= strtoupper($chars); $chars .= '0123456789'; if (empty($seed)) { mt_srand ((float) microtime() * 10

Re: [PHP] generate random ascii string

2001-09-01 Thread Philip Olson
Hi Bill, Here's a quick hack, should get you on your way : function randomString($len) { global $seed; $tmp = ''; $chars = 'abcdefghijklmnopqrstuvwxyz'; $chars .= strtoupper($chars); $chars .= '0123456789'; if (empty($seed)) { mt_srand ((float) microtime() * 100); $seed

Re: [PHP] generate random ascii string

2001-09-01 Thread Sean C. McCarthy
Hi, If you have random string including symbols just take them of with regexp. Look at the manual for regular expresion functions. Hope it helps. Sean C. McCarthy SCI, s.L. (www.sci-spain.com) bill wrote: > > How can a random string of only letters and numbers be generated? >

[PHP] generate random ascii string

2001-09-01 Thread bill
How can a random string of only letters and numbers be generated? I'm stumped so far on how to avoid including symbols. -- 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 administrat