Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with random functions

Status
Not open for further replies.

kjspear

Programmer
Joined
Feb 13, 2002
Messages
173
Location
US
Hello,

I'm having a little problem with generating random array of letters and numbers. I would like php to select 6 random letters or numbers. Here part of the code;

mt_srand((double)microtime()*1000000);
$yo1 = array("a","b","c","d","e","1","2","3","4","5");

$yo1 = $yo1[rand(0,count($yo1))];


print $yo1;



So the result should look something like this;

b42daf

Any asistance would be helpful.

Thank you
Kyle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top