So I'm building a small script that will "randomly" choose an array key, but based on the weight of the value of the key, my array looks like this:
array:2 [
1 => "10"
2 => "20"
]
So in this case key 1 would have 33.33% chance and key 2 would have 66.66% to be chosen. How would I go about doing this?