What is the correct way to pass an array using the post method in PHP?

When passing an array using the post method in PHP, you need to use square brackets [] in the name attribute of the input fields in the HTML form. This will allow PHP to recognize the input as an array when it is submitted. In the PHP code, you can access the array values using the $_POST superglobal array.

<form method="post" action="process.php">
    <input type="text" name="myArray[]" />
    <input type="text" name="myArray[]" />
    <input type="text" name="myArray[]" />
    <input type="submit" value="Submit" />
</form>
```

```php
// process.php
if(isset($_POST['myArray'])){
    $myArray = $_POST['myArray'];
    
    foreach($myArray as $value){
        echo $value . "<br>";
    }
}