Codice PHP:
$n count($array);
for(
$i=0;$i<$n;$i++)
{
   
// leggi i dati

Usa $i come indice per legger ei dati nell'array.