i declared array score, and move data input HTML from user to array score PHP here
<?php
$score= [];
if(isset($_POST['send'])){
for ($i = 0; $i < 2; $i++)
$score[] = $_POST['ID_score'];
}
?>
so the user inputed data from here
<form method="post" action="index.php">
<?php for($i = 0; $i < 2; $i++){ ?>
<label>input your ID score -[<?php echo $i++ ?>] : </label>
<input type="text" name='ID_score'>
<br>
<?php } ?>
</br><input type="submit" name="send" value="send it">
and i make a var dump to see vakue array of index...
<?php if(isset($_POST['send'])){ ?>
<h3><?php var_dump($score); ?></h3>
<?php } ?>
i input 2 score, first value i'm input 100 , in the second textbox i'm input 200
but the output array is : array(1) { [0]=> string(1) "200" }
why the output just one last array index? even though i enter two data value 100 and 200
<input type="text" name='ID_score[<?php echo $i++ ?>]'><input type="text" name='ID_score[]'>