What would be the most efficient way to select every nth item from a large array? Is there a \'smart\' way to do it or is looping the only way?
Some points to c
You can't move the array pointer, it seems, more than once at a time. I would personally use this:
reset($source);
$next = true;
while($next === true){
$result[] = current($source);
for(i=0;i<205;i++){
$next = next($source);
}
}
If someone can find a function that can move the array pointer more than just one step at a time, you will have a better answer. I think this is good though.