如何使用php从输入框中获取多个值

This is the output of my code Output

Every item has its own item number. I will be entering randomly a value for 3 items, after doing so I will click on the add button and will be redirected to a confirmation page. How will I get the values with its corresponding item?

Thanks in advance for the answers :)

Use input name as array.

<input type="text" name="price[]" />
<input type="text" name="price[]" />
<input type="text" name="price[]" />
<input type="text" name="price[]" />
<input type="text" name="price[]" />

Get values like this

$price = $_POST['price'];
foreach($price as $key => $val ) {
  echo $val;
  echo "<br>";
}

You can bind or keep the text box name same as your database row ID so when you submit and in the target page you can redo the select and update the field in the database like

<input type="text" name="$id" />

in the target page use Select Query looping and give

Update table_name set field_name=$_REQUEST[$id] where id=$id