title: PHP random string generator
body: <p>I'm trying to create a randomized string in PHP, and I get absolutely no output with this:</p>
  
  <pre><code>&lt;?php
      function RandomString()
      {
          $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
          $randstring = '';
          for ($i = 0; $i &lt; 10; $i++) {
              $randstring = $characters[rand(0, strlen($characters))];
          }
          return $randstring;
      }
  
      RandomString();
      echo $randstring;
  </code></pre>
  
  <p>What am I doing wrong?</p>