How can one display and access input field values with unique names in PHP?

When working with input fields in PHP, it is common to have multiple fields with unique names, such as an array of input fields. To display and access these values, you can use the `name` attribute in the HTML input fields to assign unique names to each field. Then, in the PHP script, you can access these values using the `$_POST` or `$_GET` superglobals by referencing the unique names assigned to the input fields.

<form method="post" action="">
    <input type="text" name="user[name]" placeholder="Enter your name">
    <input type="email" name="user[email]" placeholder="Enter your email">
    <input type="submit" value="Submit">
</form>

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $name = $_POST['user']['name'];
    $email = $_POST['user']['email'];

    echo "Name: " . $name . "<br>";
    echo "Email: " . $email;
}
?>