Re: Foreach question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I don't think that it does this:

if ( count($elements) == 1 ) then loop 1;
else loop normally;

It's probably more something like that:

$i=count($elements);
loop:
$i--;
if($i == 0)
    $last_loop = true;
else
    $last_loop = false

if($last_loop)
   exit;
else
   goto loop;



But aside from that, I would propose you the same thing Robert already
did - Just use while or some other loop (for maybe?).

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux