Re: [PHP] Testing for Current pointer position in array during iteration

2008-08-29 Thread tedd
At 11:10 PM +0200 8/29/08, Jochem Maas wrote: Mark Weaver schreef: Jochem put things back into perspective for me. I'm having that printed on a T-Shirt :-P Damn! You get more T-Shirts than me. :-) Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.c

Re: [PHP] Testing for Current pointer position in array during iteration

2008-08-29 Thread Jochem Maas
Mark Weaver schreef: tedd wrote: ... Try looking at "current" http://www.php.net/current Maybe that will help. not in the context of foreach() (I'll repeat the oneliner here because tedd's old and has a crap email client ;-): php -r '$r = array("a","b","c"); next($r); $K = key($r); fore

Re: [PHP] Testing for Current pointer position in array during iteration

2008-08-29 Thread Mark Weaver
tedd wrote: 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

Re: [PHP] Testing for Current pointer position in array during iteration

2008-08-29 Thread Mark Weaver
Jochem Maas wrote: Mark Weaver schreef: 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 have

Re: [PHP] Testing for Current pointer position in array during iteration

2008-08-29 Thread Jochem Maas
Dan Joseph schreef: On Fri, Aug 29, 2008 at 2:40 PM, Mark Weaver <[EMAIL PROTECTED]> wrote: ... This may also help as well as Jochem's suggestion: http://us2.php.net/key not unless you wan't a headache (re-read the bit about foreach's internal pointer): php -r '$r = array("a","b","c")

Re: [PHP] Testing for Current pointer position in array during iteration

2008-08-29 Thread tedd
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

Re: [PHP] Testing for Current pointer position in array during iteration

2008-08-29 Thread Dan Joseph
On Fri, Aug 29, 2008 at 2:40 PM, Mark Weaver <[EMAIL PROTECTED]> 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 point

Re: [PHP] Testing for Current pointer position in array during iteration

2008-08-29 Thread Jochem Maas
Mark Weaver schreef: 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

[PHP] Testing for Current pointer position in array during iteration

2008-08-29 Thread Mark Weaver
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 accomp