Have PHP pick given words randomly?

curtdbz

New member
I have three words, Apple, Banana, and Orange. I want PHP to pick one of them randomly, and each with a probability that I assign to it (say A = 10%, B = 85% and O = 5%). How do I do this? All I know is how to make a random number from like n to m, but I don't know how to use this to assign probabilities and for PHP to pick a word/string for me. Thanks!
 
Back
Top