How to iterate on the index of an array by an arbitrary starting point and iteration amount
What I am trying to do is:
- Push a string to an array.
- Count through the entries in the array X number of times with an offset, and return the resulting value as a variable.
I have this code so far:
$newarray = array(1,2,3,4,7,5,8,6,9);
I'd like to be able to count (for example) starting at the number 3, increment by a variable number (for example, 12) in something of a round robin manner. This would put the end of the count at the number 5. I'd then like to take that number (5) and store it in a variable for use on the rest of the page.