title: True random number generation with PHP in a raffle code
body: <p>I have a raffle like program:
  A user places x number of tokens, on an item. This gets recorded into the database as
      user_id, item_id, number_of_tokens</p>
  
  <p>When the time comes to draw, I do the following:</p>
  
  <pre><code>$ballots = array();
  $users = all users that placed at least one token on Item A.
  
  foreach( $users as $user )
  {
    $number_of_ballots = Get number of ballots this User placed on Item A
    for($i = 1; $i leq $number_of_ballots; $i++)
    {
      $ballots[] = $user-&gt;id;
    }
  }
  shuffle( $ballots );
  $winner_user_id = mt_rand(0, count($ballots) -1 );
  </code></pre>
  
  <p>Now my questions are:</p>
  
  <ul>
  <li>Does this guarantee a random selection?</li>
  <li>Does a person that put 10 tokens on Item A have 10 times higher chance of winning than a person that put 1 token on item A?</li>
  </ul>
  
  <p>Thanks for your help.</p>