undefined offset?
<p>I get an undefined offset on the list line in the code below.
Any ideas why?
the password is still generated even though I get the offset error</p>

<pre><code>function generatePassword($length=6,$level=2){

   list($usec, $sec) = explode(' ', microtime(true));
   srand((float) $sec + ((float) $usec * 100000));  

   $validchars[1] = "23456789abcdefghjkmnpqrstuvwxyz";
   $validchars[2] = "23456789abcdefghjkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ";
   $validchars[3] = "23456789_!@#$%&amp;*()-= /abcdefghjkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ_!@#$%&amp;*()-= /";

   $password  = "";
   $counter   = 0;

   while ($counter &lt; $length) {
     $actChar = substr($validchars[$level], rand(0, strlen($validchars[$level])-1), 1);

     // All character must be different
     if (!strstr($password, $actChar)) {
        $password .= $actChar;
        $counter++   ;
   }
   }

   re
</code></pre>

<p>turn $password;</p>

<p>}</p>
