title: Generating unique filename
body: <p>I want to generate a unique filename for uploaded files. They should be 5 characters in length, and have the following characters only: <code>abcdefghijklmnopqrstuvwxyz0123456789</code>. This is my code:</p>
  
  <pre><code>$chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
  $length = 5;
  $filename = '';
  for($i = 0; $i &lt; $length; $i++)
  {
      $filename += $chars[mt_rand(0, 36)];
  }
  
  echo $filename;
  </code></pre>
  
  <p>But I always end up with 1 or 2 character long integers, never any string characters. If I run this code:</p>
  
  <pre><code>$chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
  $length = 5;
  $filename = '';
  for($i = 0; $i &lt; $length; $i++)
  {
      echo $chars[mt_rand(0, 36)];
  }
  </code></pre>
  
  <p>it works fine, and I get the following output: <code>8iwzf</code>.</p>
  
  <p>What could I be doing wrong here? Thanks!</p>