What is the correct method to access form elements with the same name in PHP when using the POST method?

When accessing form elements with the same name in PHP using the POST method, you can use the `$_POST` superglobal array. Since PHP automatically converts input field names with square brackets (`[]`) into an array, you can access the values of elements with the same name by treating them as an array in your PHP code.

// Example HTML form with multiple input fields having the same name
<form method="post">
    <input type="text" name="items[]">
    <input type="text" name="items[]">
    <input type="text" name="items[]">
    <input type="submit" value="Submit">
</form>

// PHP code to access the values of elements with the same name
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $items = $_POST['items'];
    foreach ($items as $item) {
        echo $item . "<br>";
    }
}
?>