Any better (shorter) way to generate random strings?
<p>Any random number between <code>0</code> to <code>100</code> can be generated like this:</p>

<pre><code>&lt;?php
    $min = 0;
    $max = 100;
    $random =  rand($min,$max);
?&gt;
</code></pre>

<p>Now I can place this <code>$random</code> anywhere in my file to generate a random number. But the problem is when I place this on more than one place all those places have same value <em>(if one random number is <code>17</code> all will be <code>17</code>)</em>.</p>

<p>I am doing something like this to do that in more than one place:</p>

<pre><code>    $random2 =  rand($min,$max);
    $random3 =  rand($min,$max);
    $random4 =  rand($min,$max);
    $random5 =  rand($min,$max);
</code></pre>

<p>And placing those in all locations.</p>

<p>Doing so takes more of my space in my script. Is there any better way to do what I want?</p>
