why is rand() generating a low number?
<p>Here is my code</p>

<pre><code>&lt;?php

function random_id() {
    $chars = 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $id = '';
    for ($i = 0; $i &lt; 5; ++$i)
    {
        $id .= $chars[rand(1, 26)];
    }
    echo $id;
}

random_id();

?&gt;
</code></pre>

<p>It keeps generating IDs with 5 lowercase digits, and VERY occasionally it will have a number in it. I tried with <code>mt_rand()</code> as well, and also using <code>srand(time())</code> and <code>srand(microtime())</code> at the beginning of the script before the loop.</p>

<p>Also, should it be <code>rand(1, 26)</code> or <code>rand(0, 25)</code>?</p>
