I have an array with 3 entries like that:
0 => "Banana",
1 => "Apple",
2 => "Strawberry"
Now, when using a for-loop like:
for($i = 1; $i < $foo; $i++) {
$myarray[$i] = $fruitarray[$i];
}
And $i gets higher than 2, we run out of this $fruitarray. So what I want to do now is always to start at the beginning of the array when it's over. So that 3 outputs "Banana", 7 "Apple" etc.
What is the best practice to achieve this (especially if $fruitarray contains many entries)?