View Single Post
  #2  
Old 08-18-2008, 12:37 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
If I remember correctly, random(start, end) will only return a random number within [start, end)

It's a bit different to generate a random character. Here's one way to generate a random upper-case letter:
PHP Code:
char(int(random(6591))); 
You can look at an ascii table to see where I get the 65 and 91 from. You could also look at an ascii table to get the ranges for lower-case letters.

Or, you could predefine an array of all the characters you want to include in your random strings, then use randomstring().
Example:
PHP Code:
temp.chars = {"A""B""C""D""a"123};  //Put all characters in here.
temp.confCode randomstring(temp.chars) @ randomstring(temp.chars) @ randomstring(temp.chars); 
And, to save as a log/*.txt file you can use savelog2
Example:
PHP Code:
savelog2("snaps.txt""The boy bought the basketball"); 
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote