Re: end of array
| From: | Raj Shekhar | Date: | Sat, 22 Jan 2005 15:17:42 +0000 |
| Subject: | Re: end of array | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-207042@lists.php.net to get a copy of this message | ||
"M. Sokolewicz" <tularis@php.net> 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