Hi, I have a function which is called within a foreach loop and takes in two parameters, an integer, representing the number of times the loop has run and an array (of no fixed size).
I would like to return the value of the array key that is equal to the counter.
For example, if the array has four elements: A, B, C and D and the counter is equal to 2, it returns B. However, I'm trying to get the same result if the counter is equal to 6, 10, 14, 38, 3998 etc etc.
Is there a simple way to achieve this?
Any advice appreciated.
Thanks.