PHP actions in ratio
<p>I have 3 options, and they have to happen in a particular ratio.
Out of 10 times, this is the ratio:</p>

<p>8x Option 1</p>

<p>1x Option 2</p>

<p>1x Option 3</p>

<p>Right now I have the following:</p>

<pre><code>if (rand(8,10)) {
        option1();
    } elseif (rand(1,10)) {
        option2();
    } elseif (rand(1,10)) {
        option3();
    } 
</code></pre>

<p>But this gets option 1 way more than 8 times. Option 2 never occurs and option 3 rarely.</p>

<p>So, what is the correct way to achieve this?</p>
