[PHP] Re: end of array

2005-01-23 Thread Raj Shekhar
"M. Sokolewicz" <[EMAIL PROTECTED]> writes: > Raj Shekhar wrote: > > "M. Sokolewicz" <[EMAIL PROTECTED]> writes: > > > >>Raj Shekhar wrote: > > > >>>$n_elts = count($myarray); > >>>for ($i=0; $i< $n_elts ; $i++) > >>>{ > >>>if ($i = $n_elts -1) > > ^^^ > > Use of == requi

[PHP] Re: end of array

2005-01-22 Thread M. Sokolewicz
Raj Shekhar wrote: "M. Sokolewicz" <[EMAIL PROTECTED]> 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"; brea

[PHP] Re: end of array

2005-01-22 Thread Raj Shekhar
"M. Sokolewicz" <[EMAIL PROTECTED]> 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"; > >

[PHP] Re: end of array

2005-01-22 Thread M. Sokolewicz
Raj Shekhar wrote: Jeffery Fernandez <[EMAIL PROTECTED]> writes: Hi all, I have a foreach loop on an array and within that loop I need to find if the array has reached the last pointer. I have tried if (next($row)) { } but that advances the pointer. Any tips on finding out if the array pointer has

[PHP] Re: end of array

2005-01-22 Thread Raj Shekhar
Jeffery Fernandez <[EMAIL PROTECTED]> writes: > Hi all, > > I have a foreach loop on an array and within that loop I need to find > if the array has reached the last pointer. I have tried > > if (next($row)) > { > > } > > but that advances the pointer. Any tips on finding out if the array > po