Puoi usare array_splice()/foreach() oppure un semplice for() usando count() per i limiti del ciclo.