I dati ti arrivano in un array?
Puoi usare indifferentement for, while o foreach.