Maybe silly question, but I have an array and I would like to create an ArrayIterator but with an offset.
Example, I've the following array :
$fruits = [
1 => 'banana',
2 => 'apple',
3 => 'orange',
...
20 => 'raspberry'
]
My offset is 3.
I want to create an ArrayIterator with the $fruits array and the $offset. How can I do that ? I don't understand the ArrayIterator doc'. There is the OffsetSet() method but I don't understand how it works
offsetSetdoes to begin with. See here for an explanation of what it actually does: geeksforgeeks.org/php-arrayiterator-offsetset-function