Where is the error in my email activation fucntion?
<p>I am beginner, I am having small error in my email cativation function. the error is   in the line of the for loop.</p>

<pre><code>&lt;?php
function generateCode(){
$codelength = 20; 
// The length of the activation code.
$characters = "abcdefghijklmnopqrstuvwxyz1234567890"; // All accepted characters.
$activatecode = "";
for($i=0;$i&amp;lt;=$codelength;$i++){
$activatecode .= substr(str_shuffle($characters),0,1);
}
return $activatecode;
}
$userActivationCode = generateCode();
?&gt;
</code></pre>
