PC Nerd Posted March 17, 2007 Share Posted March 17, 2007 seems simple enough, but not as much as rand($ARRAY); how would i select a random element from an array??? ie $User_Prize = rand($Users); thanks Quote Link to comment Share on other sites More sharing options...
ShogunWarrior Posted March 17, 2007 Share Posted March 17, 2007 array_rand Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted March 17, 2007 Author Share Posted March 17, 2007 i assume that goes like $VARIABLE = array_rand($ARRAY); Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted March 17, 2007 Share Posted March 17, 2007 Why don't you read the entry in the manual for the function? Ken Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted March 17, 2007 Author Share Posted March 17, 2007 is it so hard to just say yes or no...... and if no then referense the manual, becauase it doesnt always explain very well. Quote Link to comment Share on other sites More sharing options...
AndyB Posted March 18, 2007 Share Posted March 18, 2007 is it so hard to just say yes or no...... and if no then referense the manual, becauase it doesnt always explain very well. You'll learn more if you look in the manual. Quote Link to comment Share on other sites More sharing options...
chawezul Posted March 18, 2007 Share Posted March 18, 2007 $array[mt_rand(0,count($array))]; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.