What is the syntax for using foreach() in PHP to iterate over form inputs?

When iterating over form inputs in PHP using foreach(), the key-value pairs of the $_POST superglobal array can be used. This allows you to loop through all form inputs submitted via POST method and access their values dynamically. By using foreach() in combination with $_POST, you can easily handle multiple form inputs without having to reference each input individually.

foreach($_POST as $key => $value) {
    // Process each form input here
    echo "Input name: " . $key . ", Value: " . $value . "<br>";
}