Re: Testing for Current pointer position in array during iteration

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

 



On Fri, Aug 29, 2008 at 2:40 PM, Mark Weaver <mdw1982@xxxxxxxxxxx> 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?
>
> thanks,
>
> --
>
> Mark
> ----------------------------
> It was good to be the fire... Better by far than to crawl and mew and suck
> and $h1t and die!
> 'Arthur C. Clarke'
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
This may also help as well as Jochem's suggestion:  http://us2.php.net/key

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."

[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