lundi 20 juillet 2015

Get random element from array with cooldown

I am currently returning a random element from an array with the following code: $items[array_rand($items)]

What I am trying to do now, is to add sort of a cooldown to the items in the array. For example if Item 2 from the array is returned, I want that item not returned until 2 minutes (or e.g. 4 other array returns) are done.

I am not sure how do achieve my goal and I am hoping for some pseudo code :)




Aucun commentaire:

Enregistrer un commentaire