I have a form that submits lots of small fields that I need to loop through and perform actions on.
The form looks like this:
Look into the use of explode() and POST variables.
Try something along the lines of:
// Loop over each item in the form.
foreach($_POST as $name => $value) {
// Split the name into an array on each underscore.
$splitString = explode("_", $name);
// If the data begins with "minnight", use it.
if ($splitString[0] == "minnight") {
// Set the other desired values into variables.
$secondValue = $splitString[1];
$thirdValue= $splitString[2];
// Database query goes here.
}
}