Posts by Lucas Carvalho • 26 points
1 post
-
1
votes2
answers436
viewsA: How do I go through the data of an array, to make a draw with odds proportions?
I believe that a better approach would be to turn these weights into indexes so perform a Random to check the range drawn. <?php $weights = ['arroz' => 2, "feijao" => 1, "macarrao" => 4,…