Re: end of array

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

 



"M. Sokolewicz" <tularis@xxxxxxx> writes:

> Raj Shekhar wrote:

> > $n_elts = count($myarray);
> > for ($i=0; $i< $n_elts ; $i++)
> > {
> >         if ($i = $n_elts -1)
                  ^^^
Use of == required to make it work 

> >         {
> >                 echo "On last element";
> >                 break;
> >         }
> >         else
> >         {
> >                 echo "Somwhere in the middle";
> >         }
> > }
> that's an eternal loop in case you hadn't noticed (*rolls eyes*)

Oops :( not eternal loop though, only one loop 

-- 
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