title: Generating unique 6 digit code
body: <p>I'm generating a 6 digit code from the following characters. These will be used to stamp on stickers.<br>
  They will be generated in batches of 10k or less (before printing) and I don't envisage there will ever be more than 1-2 million total (probably much less).<br>
  After I generate the batches of codes, I'll check the MySQL database of existing codes to ensure there are no duplicates.</p>
  
  <pre><code>// exclude problem chars: B8G6I1l0OQDS5Z2
  
  $characters = 'ACEFHJKMNPRTUVWXY4937';
  
  $string = '';
  
  for ($i = 0; $i &lt; 6; $i++) {
      $string .= $characters[rand(0, strlen($characters) - 1)];
  }   
  
  return $string;
  </code></pre>
  
  <ol>
  <li>Is this a solid approach to generating the code?</li>
  <li>How many possible permutations would there be? (6 Digit code from pool of 21 characters). Sorry math isn't my strong point</li>
  </ol>