Per scorrere un array puoi usare foreach() è molto più comodo.