r1.php > <form action="r2.php" method="POST"> > > <?php > > for($i=1; $i<=5; $i++) { > echo "<input type=checkbox name=\"ids[]\" value=". $i .">"; > } > > > ?> > > <input type="submit" value="OK" /> > > </form> > r2.php <?php $ids = $_POST['ids']; foreach ($ids as $i) { $new_ids[] = $i; } print_r($new_ids); ?> ..iterate trough the submited array with foreach instead of for...