in reply to Re: Elegantly Selecting Every 3rd Element in an Array.
in thread Elegantly Selecting Every 3rd Element in an Array.

Maybe I did something wrong, but when I run your example I get "las saturday is" and not "every third element".

"Make everything as simple as possible, but not simpler." -- Albert Einstein

  • Comment on Re: Re: Elegantly Selecting Every 3rd Element in an Array.

Replies are listed 'Best First'.
Re: Re: Re: Elegantly Selecting Every 3rd Element in an Array.
by blakem (Monsignor) on Sep 29, 2001 at 04:06 UTC
    I noticed that too.... easy fix though, replace $i=0 with $i=2. As written, the code gives you every third word, but it doesn't start on the "correct" one.

    -Blake