Re: Testing for Current pointer position in array during iteration

From: Date: Fri, 29 Aug 2008 19:23:46 +0000
Subject: Re: Testing for Current pointer position in array during iteration
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-279001@lists.php.net to get a copy of this message
At 2:40 PM -0400 8/29/08, Mark Weaver wrote:
Hi All, Go figure... I sat down today to get some more work on my current project; I got to a certain point where I need to step through an array with a foreach loop. I found that I need to test for the current pointer position of the array, but I haven't a clue as to how this might be accomplished. I've been all over google and php.net, but I'm not finding anything that will help me do this. Basically all I want to do is something like this: if( current_arrayPointer_postition == n ){ ... do this }else{ ...do this } Anyone know of a built-in PHP function that can assist with this, or can you point me to a resource that could help me code a solution?
Try looking at "current" http://www.php.net/current Maybe that will help. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#279001) next »