Welcome Guest, Not a member yet? Register   Sign In
get current array position pointer while doing foreach $object->result_array()
#1

[eluser]jayapalchandran[/eluser]
Hi,
consider this, a case.
foreach($object->result_array() as $rs)
{
//how do i display the current array element index that is the iteration index.
//i want to call a function when the iterator is in the last-1 position.
// and more specifically i want to use it in this place and not any other for(;Wink loops.
// and even it is an example with other loops then that is fine.
}

There should be an option or by using current() function.
I had tried but still i have to do some analysis...
Instead of debugging and tracing the array elements i am posting this thread.


Messages In This Thread
get current array position pointer while doing foreach $object->result_array() - by El Forum - 08-04-2010, 02:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB