Ammesso che i campi siano nome1, nome2, etc. puoi usare un codice come questo:
Codice PHP:
$count = 3;
for ($i = 1; $i <= $count; $i++) {
print($_POST['nome' . $i];
}
In alternatica, utilizza direttamente un array:
Codice PHP:
<form method="post">
<input type='text' name='nome[1]' value="a" />
<input type='text' name='nome[2]' value="b" />
<input type='text' name='nome[3]' value="c" />
<input type="submit" />
</form>
<pre>
<?php
if (isset($_POST['nome']) && is_array($_POST['nome'])) {
foreach($_POST['nome'] as $nome) {
print("{$nome}\r\n");
}
}
?>
</pre>