I have a HTML form that i populate from database with a "foreach" loop, so the fields in the name have the same name. The data that i want to post back into the databa
Am not sure what your HTML looks like but having the same name for all your inputs does not neccessarily mean they have become an array. you will need to define them as array in HTML using []
. Below is an example
HTML
PHP
if(isset($_POST['submit'])){
foreach($_POST['array'] as $myarray) {
echo $myarray.'
';
}
this should get you the unique values from each input and then you do what you want with it.
Here is a link to several other solutions that could help: Post text box array in PHP