Your problem is a basic PHP problem. You’re only looping over the even numbers, 0, 2, 4, 6
This is because at the end of every loop $offset
increases by 1:
for($offset = 0; $offset < 100; $offset++)
But then for some reason it also gets incremented before the loop ends:
$offset++;
So offset is incremented by 2, and half the values are skipped