ovvio che andava in loop, c'era l'errore, mancava =
for ( $i=200; $i<=1000; $i+=100)
for ( $i=2000; $i<=5000; $i+=1000)