Try using a for loop instead of a while loop...

example:

for( $i = 0, $tot = count($tmpparts); $i < $tot; $i++ ) {
        $content = "?>".$tmpparts[$i];
        eval($content);
        foreach($command as $name => $cmds) {
            if($tmpcmds[$i] == $name) {
                $docmd = $cmds;
                eval($docmd);
            }
        }
}

NOT TESTED...check and see if it works..


--
Ray


On Wed, 2003-02-19 at 22:54, Shawn McKenzie wrote:
> While debugging my code, that seems to work fine, I see hundreds of these
> notices, many different ones with different offset numbers same line number.
> 
> (I know I can turn notices off)
> 
> Notice: Undefined offset: 2 in
> D:\apps\www\test\themes\Family\includes\autotheme.inc.php on line 275
> 
> I would like to know what the notice pertains to (offset?)  Here's the code:
> 
> $commands is an associative array, $tmpparts and $tmpcmds are integer index
> arrays.
> 
> $i = 0;  // Line 270
>     while($i != count($tmpparts)) {
>         $content = "?>".$tmpparts[$i];
>         eval($content);
>         foreach($command as $name => $cmds) {
>             if($tmpcmds[$i] == $name) {
>                 $docmd = $cmds;
>                 eval($docmd);
>             }
>         }
>         $i++;
>     } // Line 281
> 
> TIA,
> Shawn
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to