PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
create an array with image names to choose randomly from and put the ones you want "higher weighted" in the array more times, like buying more raffle tickets
magicrobotmonkey wrote:create an array with image names to choose randomly from and put the ones you want "higher weighted" in the array more times, like buying more raffle tickets
aha, you may be oto something there. Like if i weight it 5, it appears in the array 5 times.
Yea that was more what I meant then the first one. it would be pretty easy to write a function to take an image name, an array, and a weight and insert the image name into the array weight times and the array would just be holding image names so it wouldnt be a size problem.